1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
$NetBSD: patch-ah,v 1.4 2014/06/29 19:43:54 dholland Exp $
- support struct statvfs
- sprinkle const to make newer C++ compilers happier
--- vfu/vfucopy.cpp.orig 2002-04-26 07:24:21.000000000 +0000
+++ vfu/vfucopy.cpp
@@ -17,7 +17,7 @@
#include "vfusys.h"
#include "vfucopy.h"
-char *CM_DESC[] = { "COPY", "MOVE", "LINK" };
+const char *CM_DESC[] = { "COPY", "MOVE", "LINK" };
char *copy_buff = NULL;
int ignore_copy_errors = 0; /* actually it is used for copy/move/erase */
@@ -30,9 +30,15 @@ int ignore_copy_errors = 0; /* actually
fsize_t device_free_space( const char *target ) /* user free space, NOT real! */
{
char t[MAX_PATH];
+#ifdef _SYS_STATVFS_H_
+ struct statvfs stafs;
+ str_file_path( target, t );
+ statvfs( t, &stafs );
+#else
struct statfs stafs;
str_file_path( target, t );
statfs( t, &stafs );
+#endif
return ((fsize_t)(stafs.f_bsize)) * stafs.f_bfree;
};
|