aboutsummaryrefslogtreecommitdiff
path: root/toys/other/losetup.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-01-02 02:00:35 -0600
committerRob Landley <rob@landley.net>2013-01-02 02:00:35 -0600
commit662a267c9b52f256b027d0f176a846b1d973ab99 (patch)
tree1ff58749c737a283a199e1e567894fe16a9d0ce5 /toys/other/losetup.c
parent090c5c607ec682e5cfc03bbc745cd1ed28d5d6ce (diff)
downloadtoybox-662a267c9b52f256b027d0f176a846b1d973ab99.tar.gz
Have error_msg() and friends set TT.exitval to 1 if it's still 0, clean out other places that were setting it that no longer need to.
Diffstat (limited to 'toys/other/losetup.c')
-rw-r--r--toys/other/losetup.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/toys/other/losetup.c b/toys/other/losetup.c
index aa62222c..b455f355 100644
--- a/toys/other/losetup.c
+++ b/toys/other/losetup.c
@@ -61,7 +61,7 @@ todo: basic /dev file association
static void loopback_setup(char *device, char *file)
{
struct loop_info64 *loop = (void *)(toybuf+32);
- int rc = 0, lfd = -1, ffd;
+ int lfd = -1, ffd;
unsigned flags = toys.optflags;
// Open file (ffd) and loop device (lfd)
@@ -89,7 +89,6 @@ static void loopback_setup(char *device, char *file)
if (errno == ENXIO && (flags & (FLAG_a|FLAG_j))) return;
if (errno != ENXIO || !file) {
perror_msg("%s", device ? device : "-f");
- rc = 1;
goto done;
}
}
@@ -102,7 +101,6 @@ static void loopback_setup(char *device, char *file)
if (flags & (FLAG_c|FLAG_d)) {
if (ioctl(lfd, (flags & FLAG_c) ? LOOP_SET_CAPACITY : LOOP_CLR_FD, 0)) {
perror_msg("%s", device);
- rc = 1;
goto done;
}
// Associate file with this device?
@@ -129,7 +127,6 @@ static void loopback_setup(char *device, char *file)
done:
if (file) close(ffd);
if (lfd != -1) close(lfd);
- toys.exitval |= rc;
}
// Perform an action on all currently existing loop devices