diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-01-18 10:17:32 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-01-18 10:17:32 +0000 |
commit | 6e9b72d3abab3236a2e079587ad5c5653d96e7bd (patch) | |
tree | 70a7240d7d3cb1ba0e16709dac8b154a879c975c /sysdeps/unix/sysv/linux/statvfs.c | |
parent | 3a47453d294550539dd26da02dfcecd5e09a4f0a (diff) |
Update.
* sysdeps/unix/sysv/linux/fstatvfs.c: Move actual code in...
* sysdeps/unix/sysv/linux/internal_statvfs.c: ...here. New file.
* sysdeps/unix/sysv/linux/statvfs.c: Don't use fstatvfs since the
open call would require read permission.
Patch by James Antill <james@and.org>.
* sysdeps/unix/sysv/linux/Dist: Add internal_fnmatch.c.
* inet/getnameinfo.c: Terminate host name for NI_NOFQDN.
PR1515. Patches by Hideaki YOSHIFUJI <yoshfuji@ecei.tohoku.ac.jp>.
Diffstat (limited to 'sysdeps/unix/sysv/linux/statvfs.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/statvfs.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/sysdeps/unix/sysv/linux/statvfs.c b/sysdeps/unix/sysv/linux/statvfs.c index 74c4985fe1..9bbe6c2f99 100644 --- a/sysdeps/unix/sysv/linux/statvfs.c +++ b/sysdeps/unix/sysv/linux/statvfs.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998 Free Software Foundation, Inc. +/* Copyright (C) 1998, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -26,21 +26,15 @@ int statvfs (const char *file, struct statvfs *buf) { - int save_errno; - int retval; - int fd; + struct statfs fsbuf; + struct stat st; - fd = __open (file, O_RDONLY); - if (fd < 0) + /* Get as much information as possible from the system. */ + if (__statfs (fd, &fsbuf) < 0) return -1; - /* Let fstatvfs do the real work. */ - retval = fstatvfs (fd, buf); - - /* Close the file while preserving the error number. */ - save_errno = errno; - __close (fd); - __set_errno (save_errno); - - return retval; +#include "internal_statvfs.c" + + /* We signal success if the statfs call succeeded. */ + return 0; } |