mirror of https://github.com/mirror/busybox.git
Mount error return code fix from Kent Robotti -- we must reset the error
code when looping...1_00_stable_10817
parent
b12e506d8d
commit
d9d03b83f8
9
mount.c
9
mount.c
|
@ -132,12 +132,10 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
|
||||||
|
|
||||||
specialfile = find_unused_loop_device();
|
specialfile = find_unused_loop_device();
|
||||||
if (specialfile == NULL) {
|
if (specialfile == NULL) {
|
||||||
error_msg("Could not find a spare loop device\n");
|
error_msg_and_die("Could not find a spare loop device\n");
|
||||||
return (FALSE);
|
|
||||||
}
|
}
|
||||||
if (set_loop(specialfile, lofile, 0, &loro)) {
|
if (set_loop(specialfile, lofile, 0, &loro)) {
|
||||||
error_msg("Could not setup loop device\n");
|
error_msg_and_die("Could not setup loop device\n");
|
||||||
return (FALSE);
|
|
||||||
}
|
}
|
||||||
if (!(flags & MS_RDONLY) && loro) { /* loop is ro, but wanted rw */
|
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\n");
|
||||||
|
@ -481,6 +479,7 @@ extern int mount_main(int argc, char **argv)
|
||||||
directory = strdup(m->mnt_dir);
|
directory = strdup(m->mnt_dir);
|
||||||
filesystemType = strdup(m->mnt_type);
|
filesystemType = strdup(m->mnt_type);
|
||||||
singlemount:
|
singlemount:
|
||||||
|
rc = EXIT_SUCCESS;
|
||||||
#ifdef BB_NFSMOUNT
|
#ifdef BB_NFSMOUNT
|
||||||
if (strchr(device, ':') != NULL)
|
if (strchr(device, ':') != NULL)
|
||||||
filesystemType = "nfs";
|
filesystemType = "nfs";
|
||||||
|
@ -499,8 +498,6 @@ singlemount:
|
||||||
|
|
||||||
if (all == FALSE)
|
if (all == FALSE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
rc = EXIT_SUCCESS; // Always return 0 for 'all'
|
|
||||||
}
|
}
|
||||||
if (fstabmount == TRUE)
|
if (fstabmount == TRUE)
|
||||||
endmntent(f);
|
endmntent(f);
|
||||||
|
|
|
@ -132,12 +132,10 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
|
||||||
|
|
||||||
specialfile = find_unused_loop_device();
|
specialfile = find_unused_loop_device();
|
||||||
if (specialfile == NULL) {
|
if (specialfile == NULL) {
|
||||||
error_msg("Could not find a spare loop device\n");
|
error_msg_and_die("Could not find a spare loop device\n");
|
||||||
return (FALSE);
|
|
||||||
}
|
}
|
||||||
if (set_loop(specialfile, lofile, 0, &loro)) {
|
if (set_loop(specialfile, lofile, 0, &loro)) {
|
||||||
error_msg("Could not setup loop device\n");
|
error_msg_and_die("Could not setup loop device\n");
|
||||||
return (FALSE);
|
|
||||||
}
|
}
|
||||||
if (!(flags & MS_RDONLY) && loro) { /* loop is ro, but wanted rw */
|
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\n");
|
||||||
|
@ -481,6 +479,7 @@ extern int mount_main(int argc, char **argv)
|
||||||
directory = strdup(m->mnt_dir);
|
directory = strdup(m->mnt_dir);
|
||||||
filesystemType = strdup(m->mnt_type);
|
filesystemType = strdup(m->mnt_type);
|
||||||
singlemount:
|
singlemount:
|
||||||
|
rc = EXIT_SUCCESS;
|
||||||
#ifdef BB_NFSMOUNT
|
#ifdef BB_NFSMOUNT
|
||||||
if (strchr(device, ':') != NULL)
|
if (strchr(device, ':') != NULL)
|
||||||
filesystemType = "nfs";
|
filesystemType = "nfs";
|
||||||
|
@ -499,8 +498,6 @@ singlemount:
|
||||||
|
|
||||||
if (all == FALSE)
|
if (all == FALSE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
rc = EXIT_SUCCESS; // Always return 0 for 'all'
|
|
||||||
}
|
}
|
||||||
if (fstabmount == TRUE)
|
if (fstabmount == TRUE)
|
||||||
endmntent(f);
|
endmntent(f);
|
||||||
|
|
Loading…
Reference in New Issue