forgot to remove some debugging noise
[oweals/busybox.git] / mount.c
diff --git a/mount.c b/mount.c
index f78786ebc012e73a288a110350f42fdd6d047939..7b0bf3e214e85fea245ffd7520a73a3bab0aa336 100644 (file)
--- a/mount.c
+++ b/mount.c
@@ -43,7 +43,6 @@
  *     
  */
 
-#include "busybox.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
@@ -54,6 +53,7 @@
 #if defined BB_FEATURE_USE_DEVPS_PATCH
 #include <linux/devmtab.h> /* For Erik's nifty devmtab device driver */
 #endif
+#include "busybox.h"
 
 enum {
        MS_MGC_VAL = 0xc0ed0000, /* Magic number indicatng "new" flags */
@@ -132,20 +132,20 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
 
                        specialfile = find_unused_loop_device();
                        if (specialfile == NULL) {
-                               error_msg_and_die("Could not find a spare loop device\n");
+                               error_msg_and_die("Could not find a spare loop device");
                        }
                        if (set_loop(specialfile, lofile, 0, &loro)) {
-                               error_msg_and_die("Could not setup loop device\n");
+                               error_msg_and_die("Could not setup loop device");
                        }
                        if (!(flags & MS_RDONLY) && loro) {     /* loop is ro, but wanted rw */
-                               error_msg("WARNING: loop device is read-only\n");
+                               error_msg("WARNING: loop device is read-only");
                                flags &= ~MS_RDONLY;
                        }
                }
 #endif
                status = mount(specialfile, dir, filesystemtype, flags, string_flags);
                if (errno == EROFS) {
-                       error_msg("%s is write-protected, mounting read-only\n", specialfile);
+                       error_msg("%s is write-protected, mounting read-only", specialfile);
                        status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags);
                }
        }
@@ -171,7 +171,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
 #endif
 
        if (errno == EPERM) {
-               error_msg_and_die("permission denied. Are you root?\n");
+               error_msg_and_die("permission denied. Are you root?");
        }
 
        return (FALSE);
@@ -232,13 +232,9 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
 {
        int status = 0;
 
-#if defined BB_FEATURE_USE_PROCFS
        char buf[255];
        if (strcmp(filesystemType, "auto") == 0) {
-               FILE *f = fopen("/proc/filesystems", "r");
-
-               if (f == NULL)
-                       return (FALSE);
+               FILE *f = xfopen("/proc/filesystems", "r");
 
                while (fgets(buf, sizeof(buf), f) != NULL) {
                        filesystemType = buf;
@@ -261,7 +257,6 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
                }
                fclose(f);
        } else
-#endif
 #if defined BB_FEATURE_USE_DEVPS_PATCH
        if (strcmp(filesystemType, "auto") == 0) {
                int fd, i, numfilesystems;
@@ -510,5 +505,5 @@ singlemount:
        goto singlemount;
        
 goodbye:
-       usage(mount_usage);
+       show_usage();
 }