diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-02-18 15:35:41 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-02-19 05:20:53 +0900 |
commit | 2421dd72674d55bd8ed026bdf47939cbda26152f (patch) | |
tree | fef8535611835709f31db4bf60c5b8a82dbbaa7b /src | |
parent | d499fdbcf0e5f30a84386b866c3a46058535b350 (diff) | |
download | systemd-2421dd72674d55bd8ed026bdf47939cbda26152f.tar.gz |
loop-util: fix error condition and return value
Fixes a bug introduced by da4fd28871227d23d4719e30da03af5a71f47e5a.
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/loop-util.c | 4 |
1 files 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 */ |