← Commit list

4b1f1da35

Denys Vlasenko
Denys Vlasenko
2025-07-01
SUCCESS Duration: 158s

Subject

df: -k overrides block size to 1k even if $POSIXLY_CORRECT

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/df.c+5 -2
@@ -155,6 +155,9 @@ int df_main(int argc UNUSED_PARAM, char **argv)
, &opt_t
IF_FEATURE_DF_FANCY(, &chp)
);
+ /* -k overrides $POSIXLY_CORRECT: */
+ if (opt & OPT_KILO)
+ df_disp_hr = 1024;
if (opt & OPT_MEGA)
df_disp_hr = 1024*1024;
@@ -185,8 +188,8 @@ int df_main(int argc UNUSED_PARAM, char **argv)
if (disp_units_hdr == NULL) {
#if ENABLE_FEATURE_HUMAN_READABLE
disp_units_hdr = xasprintf("%s-blocks",
- /* print df_disp_hr, show no fractionals,
- * use suffixes if OPT_POSIX is set in opt */
+ /* print df_disp_hr; show no fractionals;
+ * if -P, unit=1 (print it in full, no KMG suffixes) */
make_human_readable_str(df_disp_hr, 0, !!(opt & OPT_POSIX))
);
#else