dissect: is_loop_device() returns negative on error, don't mistake that is true
This commit is contained in:
parent
74cb2db9f4
commit
3afda7c797
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue