summaryrefslogtreecommitdiffstats
path: root/sys-utils/losetup.c
diff options
context:
space:
mode:
authorStanislav Brabec2014-05-27 20:38:17 +0200
committerKarel Zak2014-05-28 09:18:40 +0200
commitd6ef7d6c69201190d9623885d418f9bdcf31642e (patch)
treeb8a3000fffef268eefcf1388f27ff73c13ebf7cc /sys-utils/losetup.c
parentlosetup: don't clear FD at EBUSY error in loopcxt_setup_device() (diff)
downloadkernel-qcow2-util-linux-d6ef7d6c69201190d9623885d418f9bdcf31642e.tar.gz
kernel-qcow2-util-linux-d6ef7d6c69201190d9623885d418f9bdcf31642e.tar.xz
kernel-qcow2-util-linux-d6ef7d6c69201190d9623885d418f9bdcf31642e.zip
losetup: don't ignore EBUSY in losetup when the loop device is given
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>
Diffstat (limited to 'sys-utils/losetup.c')
-rw-r--r--sys-utils/losetup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c
index f6b8685a3..ecba8a56c 100644
--- a/sys-utils/losetup.c
+++ b/sys-utils/losetup.c
@@ -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 */