diff options
| author | Eric Andersen <andersen@codepoet.org> | 2000-06-07 17:28:53 +0000 |
|---|---|---|
| committer | Eric Andersen <andersen@codepoet.org> | 2000-06-07 17:28:53 +0000 |
| commit | a42982e8f569417e93bc3b47c501cbe83a5bfade (patch) | |
| tree | a28be75735aa78f38cf8464f874857fd0132c664 /util-linux | |
| parent | 1f6262b8e2b4225a028b016fed4a3a9ee717b540 (diff) | |
| download | busybox-w32-a42982e8f569417e93bc3b47c501cbe83a5bfade.tar.gz busybox-w32-a42982e8f569417e93bc3b47c501cbe83a5bfade.tar.bz2 busybox-w32-a42982e8f569417e93bc3b47c501cbe83a5bfade.zip | |
* 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.c | 27 | ||||
| -rw-r--r-- | util-linux/swaponoff.c | 2 |
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, | |||
| 154 | } | 154 | } |
| 155 | } | 155 | } |
| 156 | #endif | 156 | #endif |
| 157 | status = | 157 | status = mount(specialfile, dir, filesystemtype, flags, string_flags); |
| 158 | mount(specialfile, dir, filesystemtype, flags, string_flags); | ||
| 159 | } | 158 | } |
| 160 | 159 | ||
| 161 | 160 | ||
| @@ -176,6 +175,11 @@ do_mount(char *specialfile, char *dir, char *filesystemtype, | |||
| 176 | del_loop(specialfile); | 175 | del_loop(specialfile); |
| 177 | } | 176 | } |
| 178 | #endif | 177 | #endif |
| 178 | |||
| 179 | if (errno == EPERM) { | ||
| 180 | fatalError("mount: permission denied. Are you root?\n"); | ||
| 181 | } | ||
| 182 | |||
| 179 | return (FALSE); | 183 | return (FALSE); |
| 180 | } | 184 | } |
| 181 | 185 | ||
| @@ -307,7 +311,7 @@ mount_one(char *blockDevice, char *directory, char *filesystemType, | |||
| 307 | fakeIt, mtab_opts); | 311 | fakeIt, mtab_opts); |
| 308 | } | 312 | } |
| 309 | 313 | ||
| 310 | if (status == FALSE && whineOnErrors == TRUE) { | 314 | if (status == FALSE) { |
| 311 | if (whineOnErrors == TRUE) { | 315 | if (whineOnErrors == TRUE) { |
| 312 | fprintf(stderr, "Mounting %s on %s failed: %s\n", | 316 | fprintf(stderr, "Mounting %s on %s failed: %s\n", |
| 313 | blockDevice, directory, strerror(errno)); | 317 | blockDevice, directory, strerror(errno)); |
| @@ -458,24 +462,19 @@ extern int mount_main(int argc, char **argv) | |||
| 458 | // If the filesystem isn't noauto, | 462 | // If the filesystem isn't noauto, |
| 459 | // and isn't swap or nfs, then mount it | 463 | // and isn't swap or nfs, then mount it |
| 460 | if ((!strstr(m->mnt_opts, "noauto")) && | 464 | if ((!strstr(m->mnt_opts, "noauto")) && |
| 461 | (!strstr(m->mnt_type, "swap")) && | 465 | (!strstr(m->mnt_type, "swap")) && |
| 462 | (!strstr(m->mnt_type, "nfs"))) { | 466 | (!strstr(m->mnt_type, "nfs"))) { |
| 463 | flags = 0; | 467 | flags = 0; |
| 464 | *string_flags = '\0'; | 468 | *string_flags = '\0'; |
| 465 | parse_mount_options(m->mnt_opts, &flags, string_flags); | 469 | parse_mount_options(m->mnt_opts, &flags, string_flags); |
| 466 | /* If the directory is /, try to remount | ||
| 467 | * with the options specified in fstab */ | ||
| 468 | if (m->mnt_dir[0] == '/' && m->mnt_dir[1] == '\0') { | ||
| 469 | flags |= MS_REMOUNT; | ||
| 470 | } | ||
| 471 | if (mount_one(m->mnt_fsname, m->mnt_dir, m->mnt_type, | 470 | if (mount_one(m->mnt_fsname, m->mnt_dir, m->mnt_type, |
| 472 | flags, string_flags, useMtab, fakeIt, | 471 | flags, string_flags, useMtab, fakeIt, |
| 473 | extra_opts, FALSE)) | 472 | extra_opts, FALSE)==FALSE) |
| 474 | { | 473 | { |
| 475 | /* Try again, but this time try a remount */ | 474 | /* Try again, but this time try a remount */ |
| 476 | mount_one(m->mnt_fsname, m->mnt_dir, m->mnt_type, | 475 | mount_one(m->mnt_fsname, m->mnt_dir, m->mnt_type, |
| 477 | flags|MS_REMOUNT, string_flags, useMtab, fakeIt, | 476 | flags|MS_REMOUNT, string_flags, useMtab, fakeIt, |
| 478 | extra_opts, TRUE); | 477 | extra_opts, TRUE); |
| 479 | } | 478 | } |
| 480 | } | 479 | } |
| 481 | } | 480 | } |
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() | |||
| 83 | exit(FALSE); | 83 | exit(FALSE); |
| 84 | } | 84 | } |
| 85 | while ((m = getmntent(f)) != NULL) { | 85 | while ((m = getmntent(f)) != NULL) { |
| 86 | if (!strstr(m->mnt_type, MNTTYPE_SWAP)) { | 86 | if (strcmp(m->mnt_type, MNTTYPE_SWAP)==0) { |
| 87 | swap_enable_disable(m->mnt_fsname); | 87 | swap_enable_disable(m->mnt_fsname); |
| 88 | } | 88 | } |
| 89 | } | 89 | } |
