aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-02-16 09:46:35 +0000
committerRon Yorston <rmy@pobox.com>2020-02-16 09:46:35 +0000
commit800dbf203d5af67b9a115a4b6f1f84ca448bc755 (patch)
treeec81e71d1495efa94c17f8a998af1f62060df1ff
parent0abe89bc214c9d1f16f32c4339792066b875b7c6 (diff)
downloadbusybox-w32-800dbf203d5af67b9a115a4b6f1f84ca448bc755.tar.gz
busybox-w32-800dbf203d5af67b9a115a4b6f1f84ca448bc755.tar.bz2
busybox-w32-800dbf203d5af67b9a115a4b6f1f84ca448bc755.zip
win32: save a few bytes in statfs
Use memset() to fill the structure with zeroes, avoiding the need to set some members explicitly. Saves 16 bytes.
-rw-r--r--win32/statfs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/win32/statfs.c b/win32/statfs.c
index 6b28792e2..97b3ce679 100644
--- a/win32/statfs.c
+++ b/win32/statfs.c
@@ -35,6 +35,8 @@ int statfs(const char *file, struct statfs *buf)
35 return -1; 35 return -1;
36 } 36 }
37 37
38 memset(buf, 0, sizeof(*buf));
39
38 /* XXX I couldn't determine how to get block size. MSDN has a 40 /* XXX I couldn't determine how to get block size. MSDN has a
39 * unhelpful hard-coded list here: 41 * unhelpful hard-coded list here:
40 * http://support.microsoft.com/kb/140365 42 * http://support.microsoft.com/kb/140365
@@ -58,10 +60,10 @@ int statfs(const char *file, struct statfs *buf)
58 buf->f_blocks = total_number_of_bytes / buf->f_bsize; 60 buf->f_blocks = total_number_of_bytes / buf->f_bsize;
59 buf->f_bfree = total_number_of_free_bytes / buf->f_bsize; 61 buf->f_bfree = total_number_of_free_bytes / buf->f_bsize;
60 buf->f_bavail = free_bytes_available / buf->f_bsize; 62 buf->f_bavail = free_bytes_available / buf->f_bsize;
61 buf->f_files = 0; 63 //buf->f_files = 0;
62 buf->f_ffree = 0; 64 //buf->f_ffree = 0;
63 buf->f_fsid = serial; 65 buf->f_fsid = serial;
64 buf->f_flag = 0; 66 //buf->f_flag = 0;
65 buf->f_namelen = namelen; 67 buf->f_namelen = namelen;
66 68
67 return 0; 69 return 0;