From: Antonio Huete Jimenez Date: Wed, 29 Jun 2011 16:07:04 +0000 (+0200) Subject: df - Properly handle paths passed when -t is used. X-Git-Tag: v2.12.0~416 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/0d0db296226eacab5031a512c0ac7f2a03c41166 df - Properly handle paths passed when -t is used. Show only the related mount points for the specified filesystem(s) when option -t is used. Obtained-from: FreeBSD --- diff --git a/bin/df/df.c b/bin/df/df.c index af6264864b..32572286eb 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -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);