From 2421dd72674d55bd8ed026bdf47939cbda26152f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 18 Feb 2023 15:35:41 +0900 Subject: [PATCH] loop-util: fix error condition and return value Fixes a bug introduced by da4fd28871227d23d4719e30da03af5a71f47e5a. --- src/shared/loop-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/loop-util.c b/src/shared/loop-util.c index 5945ba2ad4..049ec21ab9 100644 --- a/src/shared/loop-util.c +++ b/src/shared/loop-util.c @@ -577,8 +577,8 @@ static int loop_device_make_internal( * device, and called LOOP_CTL_REMOVE on it. Let's retry with a new number. * -EBUSY: a file descriptor is already bound to the loopback block device. * -EUCLEAN: some left-over partition devices that were cleaned up. */ - if (!ERRNO_IS_DEVICE_ABSENT(errno) && !IN_SET(r, -EBUSY, -EUCLEAN)) - return -errno; + if (!ERRNO_IS_DEVICE_ABSENT(r) && !IN_SET(r, -EBUSY, -EUCLEAN)) + return r; /* OK, this didn't work, let's try again a bit later, but first release the lock on the * control device */ -- 2.25.1