aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-06-07 17:28:53 +0000
committerEric Andersen <andersen@codepoet.org>2000-06-07 17:28:53 +0000
commita42982e8f569417e93bc3b47c501cbe83a5bfade (patch)
treea28be75735aa78f38cf8464f874857fd0132c664 /util-linux
parent1f6262b8e2b4225a028b016fed4a3a9ee717b540 (diff)
downloadbusybox-a42982e8f569417e93bc3b47c501cbe83a5bfade.tar.gz
* Fixed 'swapon -a' and 'swapoff -a', which were broken.
* Fixed 'mount -a' so it works as expected. * Implemented 'ls -R' (enabled by enabling BB_FEATURE_LS_RECURSIVE) -Erik
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/mount.c27
-rw-r--r--util-linux/swaponoff.c2
2 files changed, 14 insertions, 15 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index ee6c9475a..76f048b1c 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -154,8 +154,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
}
}
#endif
- status =
- mount(specialfile, dir, filesystemtype, flags, string_flags);
+ status = mount(specialfile, dir, filesystemtype, flags, string_flags);
}
@@ -176,6 +175,11 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
del_loop(specialfile);
}
#endif
+
+ if (errno == EPERM) {
+ fatalError("mount: permission denied. Are you root?\n");
+ }
+
return (FALSE);
}
@@ -307,7 +311,7 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
fakeIt, mtab_opts);
}
- if (status == FALSE && whineOnErrors == TRUE) {
+ if (status == FALSE) {
if (whineOnErrors == TRUE) {
fprintf(stderr, "Mounting %s on %s failed: %s\n",
blockDevice, directory, strerror(errno));
@@ -458,24 +462,19 @@ extern int mount_main(int argc, char **argv)
// If the filesystem isn't noauto,
// and isn't swap or nfs, then mount it
if ((!strstr(m->mnt_opts, "noauto")) &&
- (!strstr(m->mnt_type, "swap")) &&
- (!strstr(m->mnt_type, "nfs"))) {
+ (!strstr(m->mnt_type, "swap")) &&
+ (!strstr(m->mnt_type, "nfs"))) {
flags = 0;
*string_flags = '\0';
parse_mount_options(m->mnt_opts, &flags, string_flags);
- /* If the directory is /, try to remount
- * with the options specified in fstab */
- if (m->mnt_dir[0] == '/' && m->mnt_dir[1] == '\0') {
- flags |= MS_REMOUNT;
- }
if (mount_one(m->mnt_fsname, m->mnt_dir, m->mnt_type,
- flags, string_flags, useMtab, fakeIt,
- extra_opts, FALSE))
+ flags, string_flags, useMtab, fakeIt,
+ extra_opts, FALSE)==FALSE)
{
/* Try again, but this time try a remount */
mount_one(m->mnt_fsname, m->mnt_dir, m->mnt_type,
- flags|MS_REMOUNT, string_flags, useMtab, fakeIt,
- extra_opts, TRUE);
+ flags|MS_REMOUNT, string_flags, useMtab, fakeIt,
+ extra_opts, TRUE);
}
}
}
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 0f8c4f5f3..83aadd08a 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -83,7 +83,7 @@ static void do_em_all()
exit(FALSE);
}
while ((m = getmntent(f)) != NULL) {
- if (!strstr(m->mnt_type, MNTTYPE_SWAP)) {
+ if (strcmp(m->mnt_type, MNTTYPE_SWAP)==0) {
swap_enable_disable(m->mnt_fsname);
}
}