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:13:36 +0200
commit0dccd1f82b8f8b30bd6b059eba9254a08fa54861 (patch)
tree3f8405886049ab1dd0b9e50822d0790e0e9e82b8
parent7f2b6a50d3c47da8a697f50c0bc191902ebec069 (diff)
downloadsystemd-0dccd1f82b8f8b30bd6b059eba9254a08fa54861.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)
-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 ed7018f57e..5f0e841ca5 100644
--- a/src/shared/dissect-image.c
+++ b/src/shared/dissect-image.c
@@ -985,7 +985,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;