summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/internal_statvfs.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-20 19:50:45 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-20 19:50:45 +0200
commit4dd9e35bfd35d3138bc44169baba098005bad51e (patch)
treea4939c43a9c3fe00eb27f023e14acc5e1fe8808c /sysdeps/unix/sysv/linux/internal_statvfs.c
parentbd42a4599d1b6f77bcfe1e4f67b7cbd9e1cb2dfd (diff)
parentf76453c31593957fec1a99b986bfa5506618b79c (diff)
Merge commit 'refs/top-bases/t/bigmem' into t/bigmem
Diffstat (limited to 'sysdeps/unix/sysv/linux/internal_statvfs.c')
-rw-r--r--sysdeps/unix/sysv/linux/internal_statvfs.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c b/sysdeps/unix/sysv/linux/internal_statvfs.c
index 2424c138ac..331ce4a2fc 100644
--- a/sysdeps/unix/sysv/linux/internal_statvfs.c
+++ b/sysdeps/unix/sysv/linux/internal_statvfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2014 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -43,9 +43,11 @@
# ifndef __ASSUME_STATFS_F_FLAGS
int
-__statvfs_getflags (const char *name, int fstype, struct stat64 *st)
+__statvfs_getflags (const char *name, int fstype, int fd)
{
- if (st == NULL)
+ struct stat64 st;
+
+ if ((fd < 0 ? stat64 (name, &st) : fstat64 (fd, &st)) < 0)
return 0;
const char *fsname = NULL;
@@ -159,7 +161,7 @@ __statvfs_getflags (const char *name, int fstype, struct stat64 *st)
/* Find out about the device the current entry is for. */
struct stat64 fsst;
if (stat64 (mntbuf.mnt_dir, &fsst) >= 0
- && st->st_dev == fsst.st_dev)
+ && st.st_dev == fsst.st_dev)
{
/* Bingo, we found the entry for the device FD is on.
Now interpret the option string. */
@@ -222,14 +224,13 @@ __statvfs_getflags (const char *name, int fstype, struct stat64 *st)
}
# endif
#else
-extern int __statvfs_getflags (const char *name, int fstype,
- struct stat64 *st);
+extern int __statvfs_getflags (const char *name, int fstype, int fd);
#endif
void
INTERNAL_STATVFS (const char *name, struct STATVFS *buf,
- struct STATFS *fsbuf, struct stat64 *st)
+ struct STATFS *fsbuf, int fd)
{
/* Now fill in the fields we have information for. */
buf->f_bsize = fsbuf->f_bsize;
@@ -272,7 +273,7 @@ INTERNAL_STATVFS (const char *name, struct STATVFS *buf,
the /etc/mtab file and search for the entry which matches the given
file. The way we can test for matching filesystem is using the
device number. */
- buf->f_flag = __statvfs_getflags (name, fsbuf->f_type, st);
+ buf->f_flag = __statvfs_getflags (name, fsbuf->f_type, fd);
else
#endif
buf->f_flag = fsbuf->f_flags ^ ST_VALID;