loop-util: fix error handling

Follow-up for 972c8db589.
This commit is contained in:
Yu Watanabe
2024-02-16 00:25:37 +09:00
parent 59a4e17249
commit 6383abd62c
+1 -1
View File
@@ -679,7 +679,7 @@ int loop_device_make_by_path_at(
else
direct = direct_flags != 0;
if (fd < 0) {
r = -errno;
r = fd;
/* Retry read-only? */
if (open_flags >= 0 || !(ERRNO_IS_PRIVILEGE(r) || r == -EROFS))