From c22acefba54f2d11e3e9c219746cef3e707fe207 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Mon, 2 Jun 2003 22:33:12 +0000 Subject: [PATCH] From the df man page: -t Only print out statistics for filesystems of the specified types. Make the behavior of df(1) conform to its man page (behavior is otherwise undefined). Submitted by: Rob Braun Obtained from: Apple --- bin/df/df.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/df/df.c b/bin/df/df.c index 33e8c01ed76..bb12fd46c7b 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -280,6 +280,15 @@ 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++; + continue; + } if (argc == 1) { bzero(&maxwidths, sizeof(maxwidths)); update_maxwidths(&maxwidths, &statfsbuf);