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:51:26 +0200 |
commit | 699f1c9ed2d6c770e401770d7f1993ca621c3a60 (patch) | |
tree | c5661707e4edc58d565d78adc4c3772e8b9404a4 | |
parent | 71ef5b6263ec1c885516472984b7ce099bb3157b (diff) | |
download | systemd-699f1c9ed2d6c770e401770d7f1993ca621c3a60.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)
(cherry picked from commit 334f8e2e8fe07e1034d8ae1f94a02312ff19c0ce)
-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 93b617c68c..5ae34c4fe4 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -844,7 +844,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; |