diff options
Diffstat (limited to 'gl/fsusage.c')
| -rw-r--r-- | gl/fsusage.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/gl/fsusage.c b/gl/fsusage.c index e26bda88..1700a19c 100644 --- a/gl/fsusage.c +++ b/gl/fsusage.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* fsusage.c -- return space usage of mounted file systems | 1 | /* fsusage.c -- return space usage of mounted file systems |
| 2 | 2 | ||
| 3 | Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2025 Free Software | 3 | Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2026 Free Software |
| 4 | Foundation, Inc. | 4 | Foundation, Inc. |
| 5 | 5 | ||
| 6 | This file is free software: you can redistribute it and/or modify | 6 | This file is free software: you can redistribute it and/or modify |
| @@ -91,10 +91,12 @@ static int | |||
| 91 | statvfs_works (void) | 91 | statvfs_works (void) |
| 92 | { | 92 | { |
| 93 | static int statvfs_works_cache = -1; | 93 | static int statvfs_works_cache = -1; |
| 94 | struct utsname name; | ||
| 95 | if (statvfs_works_cache < 0) | 94 | if (statvfs_works_cache < 0) |
| 96 | statvfs_works_cache = (uname (&name) == 0 | 95 | { |
| 97 | && 0 <= strverscmp (name.release, "2.6.36")); | 96 | struct utsname name; |
| 97 | statvfs_works_cache = (uname (&name) == 0 | ||
| 98 | && 0 <= strverscmp (name.release, "2.6.36")); | ||
| 99 | } | ||
| 98 | return statvfs_works_cache; | 100 | return statvfs_works_cache; |
| 99 | } | 101 | } |
| 100 | # endif | 102 | # endif |
| @@ -148,15 +150,6 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp) | |||
| 148 | ? PROPAGATE_ALL_ONES (fsd.f_frsize) | 150 | ? PROPAGATE_ALL_ONES (fsd.f_frsize) |
| 149 | : PROPAGATE_ALL_ONES (fsd.f_bsize)); | 151 | : PROPAGATE_ALL_ONES (fsd.f_bsize)); |
| 150 | 152 | ||
| 151 | #elif defined STAT_STATFS3_OSF1 /* OSF/1 */ | ||
| 152 | |||
| 153 | struct statfs fsd; | ||
| 154 | |||
| 155 | if (statfs (file, &fsd, sizeof (struct statfs)) != 0) | ||
| 156 | return -1; | ||
| 157 | |||
| 158 | fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize); | ||
| 159 | |||
| 160 | #elif defined STAT_STATFS2_FRSIZE /* 2.6 < glibc/Linux < 2.6.36 */ | 153 | #elif defined STAT_STATFS2_FRSIZE /* 2.6 < glibc/Linux < 2.6.36 */ |
| 161 | 154 | ||
| 162 | struct statfs fsd; | 155 | struct statfs fsd; |
| @@ -201,7 +194,7 @@ get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp) | |||
| 201 | 194 | ||
| 202 | fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize); | 195 | fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize); |
| 203 | 196 | ||
| 204 | #elif defined STAT_STATFS4 /* SVR3, old Irix */ | 197 | #elif defined STAT_STATFS4 /* SVR3 */ |
| 205 | 198 | ||
| 206 | struct statfs fsd; | 199 | struct statfs fsd; |
| 207 | 200 | ||
