aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/mount.c13
-rw-r--r--util-linux/umount.c10
2 files changed, 6 insertions, 17 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 336cff7d2..03891371a 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -45,7 +45,6 @@
45#include <mntent.h> 45#include <mntent.h>
46#include <sys/mount.h> 46#include <sys/mount.h>
47#include <ctype.h> 47#include <ctype.h>
48#include <fstab.h>
49#if defined BB_FEATURE_USE_DEVPS_PATCH 48#if defined BB_FEATURE_USE_DEVPS_PATCH
50#include <linux/devmtab.h> 49#include <linux/devmtab.h>
51#endif 50#endif
@@ -321,9 +320,6 @@ extern int mount_main(int argc, char **argv)
321 int useMtab = TRUE; 320 int useMtab = TRUE;
322 int i; 321 int i;
323 322
324 /* Only compiled in if BB_MTAB is not defined */
325 whine_if_fstab_is_missing();
326
327#if defined BB_FEATURE_USE_DEVPS_PATCH 323#if defined BB_FEATURE_USE_DEVPS_PATCH
328 if (argc == 1) { 324 if (argc == 1) {
329 int fd, i, numfilesystems; 325 int fd, i, numfilesystems;
@@ -364,14 +360,9 @@ extern int mount_main(int argc, char **argv)
364 struct mntent *m; 360 struct mntent *m;
365 361
366 while ((m = getmntent(mountTable)) != 0) { 362 while ((m = getmntent(mountTable)) != 0) {
367 struct fstab *fstabItem;
368 char *blockDevice = m->mnt_fsname; 363 char *blockDevice = m->mnt_fsname;
369
370 /* Note that if /etc/fstab is missing, libc can't fix up /dev/root for us */
371 if (strcmp(blockDevice, "/dev/root") == 0) { 364 if (strcmp(blockDevice, "/dev/root") == 0) {
372 fstabItem = getfsfile("/"); 365 find_real_root_device_name( blockDevice);
373 if (fstabItem != NULL)
374 blockDevice = fstabItem->fs_spec;
375 } 366 }
376 printf("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir, 367 printf("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir,
377 m->mnt_type, m->mnt_opts); 368 m->mnt_type, m->mnt_opts);
@@ -445,7 +436,7 @@ extern int mount_main(int argc, char **argv)
445 FILE *f = setmntent("/etc/fstab", "r"); 436 FILE *f = setmntent("/etc/fstab", "r");
446 437
447 if (f == NULL) 438 if (f == NULL)
448 fatalError( "\nCannot ream /etc/fstab: %s\n", strerror (errno)); 439 fatalError( "\nCannot read /etc/fstab: %s\n", strerror (errno));
449 440
450 while ((m = getmntent(f)) != NULL) { 441 while ((m = getmntent(f)) != NULL) {
451 // If the file system isn't noauto, 442 // If the file system isn't noauto,
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 6661db878..c34bf5fc3 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -26,7 +26,6 @@
26#include <stdio.h> 26#include <stdio.h>
27#include <sys/mount.h> 27#include <sys/mount.h>
28#include <mntent.h> 28#include <mntent.h>
29#include <fstab.h>
30#include <errno.h> 29#include <errno.h>
31 30
32 31
@@ -110,11 +109,10 @@ char *mtab_getinfo(const char *match, const char which)
110 } else { 109 } else {
111#if !defined BB_MTAB 110#if !defined BB_MTAB
112 if (strcmp(cur->device, "/dev/root") == 0) { 111 if (strcmp(cur->device, "/dev/root") == 0) {
113 struct fstab *fstabItem; 112 /* Adjusts device to be the real root device,
114 113 * or leaves device alone if it can't find it */
115 fstabItem = getfsfile("/"); 114 find_real_root_device_name( cur->device);
116 if (fstabItem != NULL) 115 return ( cur->device);
117 return fstabItem->fs_spec;
118 } 116 }
119#endif 117#endif
120 return cur->device; 118 return cur->device;