df - Properly handle paths passed when -t is used.
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Wed, 29 Jun 2011 16:07:04 +0000 (18:07 +0200)
committerThomas Nikolajsen <thomas@dragonflybsd.org>
Wed, 6 Jul 2011 10:27:55 +0000 (12:27 +0200)
Show only the related mount points for the specified filesystem(s) when
option -t is used.

Obtained-from: FreeBSD

bin/df/df.c

index af62648..3257228 100644 (file)
@@ -253,6 +253,17 @@ main(int argc, char **argv)
                        rv = 1;
                        continue;
                }
+               /*
+                * Check to make sure the arguments we've been given are
+                * satisfied. Return an error if we have been asked to
+                * list a mount point that does not match the other args
+                * we've been given (-l, -t, etc.).
+                */
+               if (checkvfsname(statfsbuf.f_fstypename, vfslist)) {
+                 rv = 1;
+                 continue;
+               }
+
                if (argc == 1) {
                        bzero(&maxwidths, sizeof(maxwidths));
                        update_maxwidths(&maxwidths, &statfsbuf, &statvfsbuf);