+ in the interest of robustness, I added
[oweals/busybox.git] / umount.c
index 6661db8789e9d1caa25496e4cfcf02ce8b13c421..92eb0a61a05c16d09b0d6620fe5c46f4c2631747 100644 (file)
--- a/umount.c
+++ b/umount.c
@@ -3,7 +3,7 @@
  * Mini umount implementation for busybox
  *
  *
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
  * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -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;
@@ -147,6 +145,9 @@ char *mtab_next(void **iter)
        return mp;
 }
 
+/* Don't bother to clean up, since exit() does that 
+ * automagically, so we can save a few bytes */
+#if 0
 void mtab_free(void)
 {
        struct _mtab_entry_t *this, *next;
@@ -162,6 +163,7 @@ void mtab_free(void)
                this = next;
        }
 }
+#endif
 
 static int do_umount(const char *name, int useMtab)
 {
@@ -258,6 +260,8 @@ extern int umount_main(int argc, char **argv)
                                doRemount = TRUE;
                                break;
 #endif
+                       case 'v':
+                               break; /* ignore -v */
                        default:
                                usage(umount_usage);
                        }