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:06:27 +0200
commit31875b3cb05a2de76054752d40a810e40c8dbe87 (patch)
tree374a662ad03d26db199461e5fd821f314097aabe
parent418cf0e78c067f7249f4769f78c8c199d907935f (diff)
downloadsystemd-31875b3cb05a2de76054752d40a810e40c8dbe87.tar.gz
dissect: is_loop_device() returns negative on error, don't mistake that is true
(cherry picked from commit 3afda7c7976c25db786948a961873fa5c2c8e0e9)
-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 ed3fb799fa..6ac36e1f07 100644
--- a/src/shared/dissect-image.c
+++ b/src/shared/dissect-image.c
@@ -991,7 +991,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;