aboutsummaryrefslogtreecommitdiff
path: root/libdiskfs/file-statfs.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2000-12-27 00:26:21 +0000
committerRoland McGrath <roland@gnu.org>2000-12-27 00:26:21 +0000
commit7a8f1284789ee9ded7ab0f2ee1921a35ed9ea255 (patch)
tree061f0ef907418cd9dfd4fc9d5003f4f56ec7cdeb /libdiskfs/file-statfs.c
parent15df16bf8667f96364265f7bd80f4c338daffa87 (diff)
downloadhurd-7a8f1284789ee9ded7ab0f2ee1921a35ed9ea255.tar.gz
hurd-7a8f1284789ee9ded7ab0f2ee1921a35ed9ea255.tar.bz2
hurd-7a8f1284789ee9ded7ab0f2ee1921a35ed9ea255.zip
2000-12-26 Roland McGrath <roland@frob.com>
* file-statfs.c (diskfs_S_file_statfs): Zero out the struct statfs before calling diskfs_set_statfs. Set f_namelen to diskfs_name_max after the call. * diskfs.h: Update comment.
Diffstat (limited to 'libdiskfs/file-statfs.c')
-rw-r--r--libdiskfs/file-statfs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libdiskfs/file-statfs.c b/libdiskfs/file-statfs.c
index ff26819f..62eaf67b 100644
--- a/libdiskfs/file-statfs.c
+++ b/libdiskfs/file-statfs.c
@@ -1,5 +1,5 @@
/* libdiskfs implementation of fs.defs: file_statfs
- Copyright (C) 1992, 1993, 1994, 1998 Free Software Foundation
+ Copyright (C) 1992,93,94,98,2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -28,7 +28,10 @@ diskfs_S_file_statfs (struct protid *file,
if (!file)
return EOPNOTSUPP;
- statbuf->f_flag = 0;
+ /* Start will all zeros, so the fs can skip fields for which
+ it has no information to contribute. */
+ bzero (statbuf, sizeof *statbuf);
+
if (diskfs_readonly)
statbuf->f_flag |= ST_RDONLY;
if (_diskfs_nosuid)
@@ -40,5 +43,7 @@ diskfs_S_file_statfs (struct protid *file,
diskfs_set_statfs (statbuf);
+ statbuf->f_namelen = diskfs_name_max;
+
return 0;
}