dissect: is_loop_device() returns negative on error, don't mistake that is true

This commit is contained in:
Lennart Poettering 2020-09-17 17:24:33 +02:00
parent 74cb2db9f4
commit 3afda7c797
1 changed files with 1 additions and 1 deletions

View File

@ -1033,7 +1033,7 @@ static int mount_partition(
/* If requested, turn on discard support. */ /* If requested, turn on discard support. */
if (fstype_can_discard(fstype) && if (fstype_can_discard(fstype) &&
((flags & DISSECT_IMAGE_DISCARD) || ((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"); options = strdup("discard");
if (!options) if (!options)
return -ENOMEM; return -ENOMEM;