From fa43d4687c1046a72543323b4102c73106bc4645 Mon Sep 17 00:00:00 2001 From: Antonio Huete Jimenez Date: Wed, 29 Jun 2011 18:07:04 +0200 Subject: [PATCH] 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 --- bin/df/df.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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); -- 2.41.0