]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
losetup: don't ignore EBUSY in losetup when the loop device is given
authorStanislav Brabec <sbrabec@suse.cz>
Tue, 27 May 2014 18:38:17 +0000 (20:38 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 28 May 2014 07:18:40 +0000 (09:18 +0200)
losetup ignores the EBUSY error.  In the loop fo A_CREATE action, it skips
the error handling when errno = EBUSY.  It's OK for the case where no loop
device is specified, but the error has to be handled when the device is given
explicitly.

Author:  Takashi Iwai <tiwai@suse.de>
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
sys-utils/losetup.c

index f6b8685a36e8efeef50e21108a0e2d6367804d1f..ecba8a56ca4e8dd37a952ff21beec63b90d1adf9 100644 (file)
@@ -662,7 +662,7 @@ int main(int argc, char **argv)
                        res = loopcxt_setup_device(&lc);
                        if (res == 0)
                                break;                  /* success */
-                       if (errno == EBUSY)
+                       if (errno == EBUSY && !hasdev)
                                continue;
 
                        /* errors */