Source-Changes-HG archive

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

[src/trunk]: src/bin/df Fix PR3474: df -t/df -l confused by stacked local mou...



details:   https://anonhg.NetBSD.org/src/rev/192461b3d179
branches:  trunk
changeset: 474949:192461b3d179
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Tue Jul 27 12:13:19 1999 +0000

description:
Fix PR3474: df -t/df -l confused by stacked local mounts.
(Ross's patch in the PR appears to Just Work).

diffstat:

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

diffs (37 lines):

diff -r e157e6235d09 -r 192461b3d179 bin/df/df.c
--- a/bin/df/df.c       Tue Jul 27 06:23:57 1999 +0000
+++ b/bin/df/df.c       Tue Jul 27 12:13:19 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: df.c,v 1.31 1998/10/08 02:10:36 wsanchez Exp $ */
+/*     $NetBSD: df.c,v 1.32 1999/07/27 12:13:19 sommerfeld Exp $       */
 
 /*
  * Copyright (c) 1980, 1990, 1993, 1994
@@ -49,7 +49,7 @@
 #if 0
 static char sccsid[] = "@(#)df.c       8.7 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: df.c,v 1.31 1998/10/08 02:10:36 wsanchez Exp $");
+__RCSID("$NetBSD: df.c,v 1.32 1999/07/27 12:13:19 sommerfeld Exp $");
 #endif
 #endif /* not lint */
 
@@ -297,8 +297,17 @@
                        continue;
                if (nflag)
                        mntbuf[j] = mntbuf[i];
-               else
+               else {
+                       struct statfs layerbuf = mntbuf[i];
                        (void)statfs(mntbuf[i].f_mntonname, &mntbuf[j]);
+                       /*
+                        * If the FS name changed, then new data is for
+                        * a different layer and we don't want it.
+                        */
+                       if(memcmp(layerbuf.f_mntfromname,
+                                mntbuf[j].f_mntfromname, MNAMELEN))
+                                mntbuf[j] = layerbuf;
+               }
                j++;
        }
        return (j);



Home | Main Index | Thread Index | Old Index