diff options
Diffstat (limited to 'df.c')
-rw-r--r-- | df.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -31,6 +31,7 @@ | |||
31 | static const char df_usage[] = "df [filesystem ...]\n" | 31 | static const char df_usage[] = "df [filesystem ...]\n" |
32 | "\n" "\tPrint the filesystem space used and space available.\n"; | 32 | "\n" "\tPrint the filesystem space used and space available.\n"; |
33 | 33 | ||
34 | extern const char mtab_file[]; /* Defined in utility.c */ | ||
34 | 35 | ||
35 | static int df(char *device, const char *mountPoint) | 36 | static int df(char *device, const char *mountPoint) |
36 | { | 37 | { |
@@ -113,7 +114,7 @@ extern int df_main(int argc, char **argv) | |||
113 | int status; | 114 | int status; |
114 | 115 | ||
115 | while (argc > 1) { | 116 | while (argc > 1) { |
116 | if ((mountEntry = findMountPoint(argv[1], "/proc/mounts")) == | 117 | if ((mountEntry = findMountPoint(argv[1], mtab_file)) == |
117 | 0) { | 118 | 0) { |
118 | fprintf(stderr, "%s: can't find mount point.\n", argv[1]); | 119 | fprintf(stderr, "%s: can't find mount point.\n", argv[1]); |
119 | return 1; | 120 | return 1; |
@@ -129,9 +130,9 @@ extern int df_main(int argc, char **argv) | |||
129 | FILE *mountTable; | 130 | FILE *mountTable; |
130 | struct mntent *mountEntry; | 131 | struct mntent *mountEntry; |
131 | 132 | ||
132 | mountTable = setmntent("/proc/mounts", "r"); | 133 | mountTable = setmntent(mtab_file, "r"); |
133 | if (mountTable == 0) { | 134 | if (mountTable == 0) { |
134 | perror("/proc/mounts"); | 135 | perror(mtab_file); |
135 | exit(FALSE); | 136 | exit(FALSE); |
136 | } | 137 | } |
137 | 138 | ||