summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath2001-03-02 22:21:34 +0000
committerGlenn L McGrath2001-03-02 22:21:34 +0000
commit323434be429554d41f3f4764c34fd85bfbeed79a (patch)
tree179079ed7bce2c5283efe2411b43de7ec845e6ba
parent446dd27843cd9ba7dfa45ef4b28abb2dd83cde8d (diff)
downloadbusybox-323434be429554d41f3f4764c34fd85bfbeed79a.zip
busybox-323434be429554d41f3f4764c34fd85bfbeed79a.tar.gz
Dont try to automount some specific filesystem types
-rw-r--r--mount.c18
-rw-r--r--util-linux/mount.c18
2 files changed, 28 insertions, 8 deletions
diff --git a/mount.c b/mount.c
index cddccad..fd68daf 100644
--- a/mount.c
+++ b/mount.c
@@ -239,18 +239,28 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
int status = 0;
if (strcmp(filesystemType, "auto") == 0) {
- int i=0;
+ static const char *strings[] = { "tmpfs", "shm", "proc", "ramfs", "devpts", 0 };
+ const char** nodevfss;
const int num_of_filesystems = sysfs(3, 0, 0);
char buf[255];
+ int i=0;
+
filesystemType=buf;
while(i < num_of_filesystems) {
sysfs(2, i++, filesystemType);
- status = do_mount(blockDevice, directory, filesystemType,
+ for (nodevfss = strings; *nodevfss; nodevfss++) {
+ if (!strcmp(filesystemType, *nodevfss)) {
+ break;
+ }
+ }
+ if (!*nodevfss) {
+ status = do_mount(blockDevice, directory, filesystemType,
flags | MS_MGC_VAL, string_flags,
useMtab, fakeIt, mtab_opts);
- if (status == TRUE)
- break;
+ if (status == TRUE)
+ break;
+ }
}
} else {
status = do_mount(blockDevice, directory, filesystemType,
diff --git a/util-linux/mount.c b/util-linux/mount.c
index cddccad..fd68daf 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -239,18 +239,28 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
int status = 0;
if (strcmp(filesystemType, "auto") == 0) {
- int i=0;
+ static const char *strings[] = { "tmpfs", "shm", "proc", "ramfs", "devpts", 0 };
+ const char** nodevfss;
const int num_of_filesystems = sysfs(3, 0, 0);
char buf[255];
+ int i=0;
+
filesystemType=buf;
while(i < num_of_filesystems) {
sysfs(2, i++, filesystemType);
- status = do_mount(blockDevice, directory, filesystemType,
+ for (nodevfss = strings; *nodevfss; nodevfss++) {
+ if (!strcmp(filesystemType, *nodevfss)) {
+ break;
+ }
+ }
+ if (!*nodevfss) {
+ status = do_mount(blockDevice, directory, filesystemType,
flags | MS_MGC_VAL, string_flags,
useMtab, fakeIt, mtab_opts);
- if (status == TRUE)
- break;
+ if (status == TRUE)
+ break;
+ }
}
} else {
status = do_mount(blockDevice, directory, filesystemType,