Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/df Set totals.f_frsize to DEV_BSIZE instead of totals.f_...



details:   https://anonhg.NetBSD.org/src/rev/78bffc9807aa
branches:  trunk
changeset: 1026568:78bffc9807aa
user:      simonb <simonb%NetBSD.org@localhost>
date:      Mon Nov 29 05:59:58 2021 +0000

description:
Set totals.f_frsize to DEV_BSIZE instead of totals.f_bsize so that
addstat() uses an initialised value for total size calculations.
Fixes core dump for "df -c".

diffstat:

 bin/df/df.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r a6d5ed409863 -r 78bffc9807aa bin/df/df.c
--- a/bin/df/df.c       Mon Nov 29 03:57:22 2021 +0000
+++ b/bin/df/df.c       Mon Nov 29 05:59:58 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: df.c,v 1.98 2021/01/03 01:43:12 ginsbach Exp $ */
+/*     $NetBSD: df.c,v 1.99 2021/11/29 05:59:58 simonb Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993, 1994
@@ -45,7 +45,7 @@
 #if 0
 static char sccsid[] = "@(#)df.c       8.7 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: df.c,v 1.98 2021/01/03 01:43:12 ginsbach Exp $");
+__RCSID("$NetBSD: df.c,v 1.99 2021/11/29 05:59:58 simonb Exp $");
 #endif
 #endif /* not lint */
 
@@ -213,7 +213,7 @@
 
        if (cflag) {
                memset(&totals, 0, sizeof(totals));
-               totals.f_bsize = DEV_BSIZE;
+               totals.f_frsize = DEV_BSIZE;
                strlcpy(totals.f_mntfromname, "total",
                        sizeof(totals.f_mntfromname));
        }



Home | Main Index | Thread Index | Old Index