]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/loopdev: fix loopdev_find_by_backing_file()
authorKarel Zak <kzak@redhat.com>
Wed, 19 Dec 2012 11:40:19 +0000 (12:40 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 19 Dec 2012 11:40:19 +0000 (12:40 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/loopdev.c

index a404e6644be625429d688673e9d85dacac6179ba..c29cb85c5108f4ea00c083d581cf5c31cc3f9ef9 100644 (file)
@@ -1353,7 +1353,7 @@ char *loopdev_find_by_backing_file(const char *filename, uint64_t offset, int fl
 
        if (loopcxt_init(&lc, 0))
                return NULL;
-       if (loopcxt_find_by_backing_file(&lc, filename, offset, flags))
+       if (loopcxt_find_by_backing_file(&lc, filename, offset, flags) == 0)
                res = loopcxt_strdup_device(&lc);
        loopcxt_deinit(&lc);