aboutsummaryrefslogtreecommitdiff
path: root/df.c
diff options
context:
space:
mode:
Diffstat (limited to 'df.c')
-rw-r--r--df.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/df.c b/df.c
index f8a953f7d..94b6b8231 100644
--- a/df.c
+++ b/df.c
@@ -31,6 +31,7 @@
31static const char df_usage[] = "df [filesystem ...]\n" 31static 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
34extern const char mtab_file[]; /* Defined in utility.c */
34 35
35static int df(char *device, const char *mountPoint) 36static 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