Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/coreutils/df.c b/coreutils/df.c
- index f6d66e4b6..90cde5e3f 100644
- --- a/coreutils/df.c
- +++ b/coreutils/df.c
- @@ -77,6 +77,7 @@
- //usage: "/dev/sda3 17381728 17107080 274648 98% /\n"
- #include <mntent.h>
- +#include <unistd.h>
- #include <sys/statvfs.h>
- #include "libbb.h"
- #include "unicode.h"
- @@ -231,7 +232,8 @@ int df_main(int argc UNUSED_PARAM, char **argv)
- if (opt & OPT_INODE) {
- s.f_blocks = s.f_files;
- - s.f_bavail = s.f_bfree = s.f_ffree;
- + s.f_bfree = s.f_ffree;
- + s.f_bavail = s.f_favail;
- s.f_frsize = 1;
- if (df_disp_hr)
- df_disp_hr = 1;
- @@ -304,13 +306,14 @@ int df_main(int argc UNUSED_PARAM, char **argv)
- printf("%9s %3u%% %s\n",
- /* f_bavail x f_frsize / df_disp_hr, show one fractional,
- * use suffixes if df_disp_hr == 0 */
- - make_human_readable_str(s.f_bavail, s.f_frsize, df_disp_hr),
- + make_human_readable_str(getuid() ? s.f_bavail : s.f_bfree,
- + s.f_frsize, df_disp_hr),
- blocks_percent_used, mount_point);
- #else
- printf(" %9lu %9lu %9lu %3u%% %s\n",
- kscale(s.f_blocks, s.f_frsize),
- kscale(s.f_blocks - s.f_bfree, s.f_frsize),
- - kscale(s.f_bavail, s.f_frsize),
- + kscale(getuid() ? s.f_bavail : s.f_bfree, s.f_frsize),
- blocks_percent_used, mount_point);
- #endif
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement