diff options
| author | Eric Andersen <andersen@codepoet.org> | 1999-10-16 15:48:40 +0000 |
|---|---|---|
| committer | Eric Andersen <andersen@codepoet.org> | 1999-10-16 15:48:40 +0000 |
| commit | cb6e25655f894c90e4befc4bee0e66794dd6858f (patch) | |
| tree | e98863094266c328ffebe2920d0aead3c52cc121 /util-linux | |
| parent | 3c163822d88105450806fdb6a29fdfc2511267d1 (diff) | |
| download | busybox-w32-cb6e25655f894c90e4befc4bee0e66794dd6858f.tar.gz busybox-w32-cb6e25655f894c90e4befc4bee0e66794dd6858f.tar.bz2 busybox-w32-cb6e25655f894c90e4befc4bee0e66794dd6858f.zip | |
More stuff
Diffstat (limited to 'util-linux')
| -rw-r--r-- | util-linux/mount.c | 13 |
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 | } |
