diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-09-17 17:24:33 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-09-20 12:43:44 +0200 |
commit | 334f8e2e8fe07e1034d8ae1f94a02312ff19c0ce (patch) | |
tree | c259d7bc314e8a7d4d8b57276fa9a426dad18ecb | |
parent | b6efbbfb001a41c4e74a716f73c67abe8250594e (diff) | |
download | systemd-334f8e2e8fe07e1034d8ae1f94a02312ff19c0ce.tar.gz |
dissect: is_loop_device() returns negative on error, don't mistake that is true
(cherry picked from commit 3afda7c7976c25db786948a961873fa5c2c8e0e9)
(cherry picked from commit 31875b3cb05a2de76054752d40a810e40c8dbe87)
(cherry picked from commit 0dccd1f82b8f8b30bd6b059eba9254a08fa54861)
-rw-r--r-- | src/shared/dissect-image.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 29b72e7375..a713e852f7 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -843,7 +843,7 @@ static int mount_partition( /* If requested, turn on discard support. */ if (fstype_can_discard(fstype) && ((flags & DISSECT_IMAGE_DISCARD) || - ((flags & DISSECT_IMAGE_DISCARD_ON_LOOP) && is_loop_device(m->node)))) { + ((flags & DISSECT_IMAGE_DISCARD_ON_LOOP) && is_loop_device(m->node) > 0))) { options = strdup("discard"); if (!options) return -ENOMEM; |