From: Yu Watanabe Date: Sat, 18 Feb 2023 06:35:41 +0000 (+0900) Subject: loop-util: fix error condition and return value X-Git-Tag: v254-rc1~1238 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2421dd72674d55bd8ed026bdf47939cbda26152f;p=thirdparty%2Fsystemd.git loop-util: fix error condition and return value Fixes a bug introduced by da4fd28871227d23d4719e30da03af5a71f47e5a. --- diff --git a/src/shared/loop-util.c b/src/shared/loop-util.c index 5945ba2ad45..049ec21ab94 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 */