pkgsrc/misc/vfu/patches/patch-ac

60 lines
2 KiB
Text

$NetBSD: patch-ac,v 1.10 2004/05/24 09:10:06 adam Exp $
--- vfu/vfu.cpp.orig 2002-05-24 16:55:36.000000000 +0000
+++ vfu/vfu.cpp
@@ -9,6 +9,7 @@
*
*/
+#include <stdarg.h>
#include "vfu.h"
#include "vfuopt.h"
#include "vfufiles.h"
@@ -485,8 +486,6 @@ void vfu_help()
mb.push( " 1. $HOME/$RC_PREFIX/vfu/vfu.conf");
mb.push( " 2. $HOME/.vfu/vfu.conf");
mb.push( " 3. " FILENAME_CONF_GLOBAL0 );
- mb.push( " 4. " FILENAME_CONF_GLOBAL1 );
- mb.push( " 5. " FILENAME_CONF_GLOBAL2 );
mb.push( "" );
vfu_menu_box( 1, 4, "VFU Help ( PageUp/PageDown to scroll )" );
mb.zap();
@@ -604,10 +603,6 @@ void vfu_init()
{ /* cannot find local/user conf file, try globals */
if ( access( FILENAME_CONF_GLOBAL0, R_OK ) == 0 )
filename_conf = FILENAME_CONF_GLOBAL0;
- if ( access( FILENAME_CONF_GLOBAL1, R_OK ) == 0 )
- filename_conf = FILENAME_CONF_GLOBAL1;
- if ( access( FILENAME_CONF_GLOBAL2, R_OK ) == 0 )
- filename_conf = FILENAME_CONF_GLOBAL2;
/* if we get here then no readable conf file found */
}
@@ -1157,8 +1152,13 @@ void update_status()
files_size += s;
}
/* current fs statistics */
+#ifdef _SYS_STATVFS_H_
+ struct statvfs stafs;
+ statvfs( ".", &stafs );
+#else
struct statfs stafs;
statfs( ".", &stafs );
+#endif
fs_free = (fsize_t)(stafs.f_bsize) * (opt.show_user_free?stafs.f_bavail:stafs.f_bfree);
fs_total = (fsize_t)(stafs.f_bsize) * stafs.f_blocks;
fs_block_size = (fsize_t)(stafs.f_bsize);
@@ -2391,8 +2391,13 @@ void vfu_jump_to_mountpoint( int all )
str_word( str, " \t", t ); /* get mount point */
va.set( z, t ); /* replace line with mount point only */
+#ifdef _SYS_STATVFS_H_
+ struct statvfs stafs;
+ statvfs( t, &stafs );
+#else
struct statfs stafs;
statfs( t, &stafs );
+#endif
int hk = ('A'+ z); /* hot key */
#ifdef _TARGET_GO32_
if (toupper(t[0]) >= 'A' && toupper(t[0]) <= 'Z' && toupper(t[1]) == ':')