diff options
author | Erik Andersen | 2000-03-22 07:12:05 +0000 |
---|---|---|
committer | Erik Andersen | 2000-03-22 07:12:05 +0000 |
commit | ec5bd90916b6e815a36c14ac04d1b78e3e487400 (patch) | |
tree | 3602e12b02fe289306dccfb27fba31fda53db690 /util-linux | |
parent | 016ffe93077975b01e84493d7cc303f78f70441a (diff) | |
download | busybox-ec5bd90916b6e815a36c14ac04d1b78e3e487400.zip busybox-ec5bd90916b6e815a36c14ac04d1b78e3e487400.tar.gz |
Use the nice new find_real_root_device function to find the
name of the root device, instead of having libc read whatever
lies happen to be in /etc/mtab.
-Erik
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/mount.c | 13 | ||||
-rw-r--r-- | util-linux/umount.c | 10 |
2 files changed, 6 insertions, 17 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c index 336cff7..0389137 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -45,7 +45,6 @@ #include <mntent.h> #include <sys/mount.h> #include <ctype.h> -#include <fstab.h> #if defined BB_FEATURE_USE_DEVPS_PATCH #include <linux/devmtab.h> #endif @@ -321,9 +320,6 @@ extern int mount_main(int argc, char **argv) int useMtab = TRUE; int i; - /* Only compiled in if BB_MTAB is not defined */ - whine_if_fstab_is_missing(); - #if defined BB_FEATURE_USE_DEVPS_PATCH if (argc == 1) { int fd, i, numfilesystems; @@ -364,14 +360,9 @@ extern int mount_main(int argc, char **argv) struct mntent *m; while ((m = getmntent(mountTable)) != 0) { - struct fstab *fstabItem; char *blockDevice = m->mnt_fsname; - - /* Note that if /etc/fstab is missing, libc can't fix up /dev/root for us */ if (strcmp(blockDevice, "/dev/root") == 0) { - fstabItem = getfsfile("/"); - if (fstabItem != NULL) - blockDevice = fstabItem->fs_spec; + find_real_root_device_name( blockDevice); } printf("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir, m->mnt_type, m->mnt_opts); @@ -445,7 +436,7 @@ extern int mount_main(int argc, char **argv) FILE *f = setmntent("/etc/fstab", "r"); if (f == NULL) - fatalError( "\nCannot ream /etc/fstab: %s\n", strerror (errno)); + fatalError( "\nCannot read /etc/fstab: %s\n", strerror (errno)); while ((m = getmntent(f)) != NULL) { // If the file system isn't noauto, diff --git a/util-linux/umount.c b/util-linux/umount.c index 6661db8..c34bf5f 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c @@ -26,7 +26,6 @@ #include <stdio.h> #include <sys/mount.h> #include <mntent.h> -#include <fstab.h> #include <errno.h> @@ -110,11 +109,10 @@ char *mtab_getinfo(const char *match, const char which) } else { #if !defined BB_MTAB if (strcmp(cur->device, "/dev/root") == 0) { - struct fstab *fstabItem; - - fstabItem = getfsfile("/"); - if (fstabItem != NULL) - return fstabItem->fs_spec; + /* Adjusts device to be the real root device, + * or leaves device alone if it can't find it */ + find_real_root_device_name( cur->device); + return ( cur->device); } #endif return cur->device; |