diff options
Diffstat (limited to 'df.c')
-rw-r--r-- | df.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -2,7 +2,7 @@ | |||
2 | /* | 2 | /* |
3 | * Mini df implementation for busybox | 3 | * Mini df implementation for busybox |
4 | * | 4 | * |
5 | * Copyright (C) 1999 by Lineo, inc. | 5 | * Copyright (C) 1999,2000 by Lineo, inc. |
6 | * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> | 6 | * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org> |
7 | * based on original code by (I think) Bruce Perens <bruce@pixar.com>. | 7 | * based on original code by (I think) Bruce Perens <bruce@pixar.com>. |
8 | * | 8 | * |
@@ -28,9 +28,8 @@ | |||
28 | #include <sys/stat.h> | 28 | #include <sys/stat.h> |
29 | #include <sys/vfs.h> | 29 | #include <sys/vfs.h> |
30 | 30 | ||
31 | static const char df_usage[] = "df [filesystem ...]\n" | 31 | static const char df_usage[] = "df [filesystem ...]\n\n" |
32 | 32 | "Print the filesystem space used and space available.\n"; | |
33 | "\n" "\tPrint the filesystem space used and space available.\n"; | ||
34 | 33 | ||
35 | extern const char mtab_file[]; /* Defined in utility.c */ | 34 | extern const char mtab_file[]; /* Defined in utility.c */ |
36 | 35 | ||
@@ -76,6 +75,9 @@ extern int df_main(int argc, char **argv) | |||
76 | struct mntent *mountEntry; | 75 | struct mntent *mountEntry; |
77 | int status; | 76 | int status; |
78 | 77 | ||
78 | if (**(argv + 1) == '-') { | ||
79 | usage(df_usage); | ||
80 | } | ||
79 | while (argc > 1) { | 81 | while (argc > 1) { |
80 | if ((mountEntry = findMountPoint(argv[1], mtab_file)) == 0) { | 82 | if ((mountEntry = findMountPoint(argv[1], mtab_file)) == 0) { |
81 | fprintf(stderr, "%s: can't find mount point.\n", argv[1]); | 83 | fprintf(stderr, "%s: can't find mount point.\n", argv[1]); |