]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
losetup: return EXIT_FAILURE on unsuccessful -f
authorKarel Zak <kzak@redhat.com>
Tue, 13 May 2014 09:34:30 +0000 (11:34 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 13 May 2014 09:34:30 +0000 (11:34 +0200)
Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/losetup.c

index 275ae45847719e976b780be03fb7e893f8dca509..f6b8685a36e8efeef50e21108a0e2d6367804d1f 100644 (file)
@@ -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));