summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-09-17 17:24:33 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-09-20 12:43:44 +0200
commit334f8e2e8fe07e1034d8ae1f94a02312ff19c0ce (patch)
treec259d7bc314e8a7d4d8b57276fa9a426dad18ecb
parentb6efbbfb001a41c4e74a716f73c67abe8250594e (diff)
downloadsystemd-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.c2
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;