aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>1999-10-16 15:48:40 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>1999-10-16 15:48:40 +0000
commitc499de20c6b10ba483515e48aa61c4e5bb642f7c (patch)
treee98863094266c328ffebe2920d0aead3c52cc121 /util-linux
parentfd924d90c1fdac2f9cd33e065c7aa540d0f65167 (diff)
downloadbusybox-w32-c499de20c6b10ba483515e48aa61c4e5bb642f7c.tar.gz
busybox-w32-c499de20c6b10ba483515e48aa61c4e5bb642f7c.tar.bz2
busybox-w32-c499de20c6b10ba483515e48aa61c4e5bb642f7c.zip
More stuff
git-svn-id: svn://busybox.net/trunk/busybox@28 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/mount.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index d7b2682ce..26d4693d0 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -174,17 +174,26 @@ extern int mount_main (int argc, char **argv)
174 char *filesystemType = "auto"; 174 char *filesystemType = "auto";
175 char *device = NULL; 175 char *device = NULL;
176 char *directory = NULL; 176 char *directory = NULL;
177 struct stat statBuf;
177 int all = 0; 178 int all = 0;
178 int i; 179 int i;
179 180
181 if (stat("/etc/fstab", &statBuf) < 0)
182 fprintf(stderr, "/etc/fstab file missing -- Please install one.\n\n");
183
180 if (argc == 1) { 184 if (argc == 1) {
181 FILE *mountTable; 185 FILE *mountTable;
182 if ((mountTable = setmntent ("/proc/mounts", "r"))) { 186 if ((mountTable = setmntent ("/proc/mounts", "r"))) {
183 struct mntent *m; 187 struct mntent *m;
184 while ((m = getmntent (mountTable)) != 0) { 188 while ((m = getmntent (mountTable)) != 0) {
189 struct fstab* fstabItem;
185 char *blockDevice = m->mnt_fsname; 190 char *blockDevice = m->mnt_fsname;
186 if (strcmp (blockDevice, "/dev/root") == 0) 191 /* Note that if /etc/fstab is missing, libc can't fix up /dev/root for us */
187 blockDevice = (getfsfile ("/"))->fs_spec; 192 if (strcmp (blockDevice, "/dev/root") == 0) {
193 fstabItem = getfsfile ("/");
194 if (fstabItem != NULL)
195 blockDevice = fstabItem->fs_spec;
196 }
188 printf ("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir, 197 printf ("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir,
189 m->mnt_type, m->mnt_opts); 198 m->mnt_type, m->mnt_opts);
190 } 199 }