summaryrefslogtreecommitdiffstats
path: root/sys-utils/losetup.c
diff options
context:
space:
mode:
authorKarel Zak2014-05-13 11:34:30 +0200
committerKarel Zak2014-05-13 11:34:30 +0200
commit3e55659feb74adfd4bbefe1c985e5e5af5c7a9f3 (patch)
treea8196a2d3dc98cbc29e8d8948ee864a2bccffc20 /sys-utils/losetup.c
parentagetty: beside virtual consoles support xvc and hvc device lines as well (diff)
downloadkernel-qcow2-util-linux-3e55659feb74adfd4bbefe1c985e5e5af5c7a9f3.tar.gz
kernel-qcow2-util-linux-3e55659feb74adfd4bbefe1c985e5e5af5c7a9f3.tar.xz
kernel-qcow2-util-linux-3e55659feb74adfd4bbefe1c985e5e5af5c7a9f3.zip
losetup: return EXIT_FAILURE on unsuccessful -f
Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/losetup.c')
-rw-r--r--sys-utils/losetup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c
index 275ae4584..f6b8685a3 100644
--- a/sys-utils/losetup.c
+++ b/sys-utils/losetup.c
@@ -694,7 +694,8 @@ int main(int argc, char **argv)
res = delete_all_loops(&lc);
break;
case A_FIND_FREE:
- if (loopcxt_find_unused(&lc))
+ res = loopcxt_find_unused(&lc);
+ if (res)
warn(_("cannot find an unused loop device"));
else
printf("%s\n", loopcxt_get_device(&lc));