1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-12 09:17:44 +03:00

loop-util: make loop_device_make() return fd in all code paths

Previously, loop_device_make() would return the device fd in one success
code path, but not the other (where' we'd just return 0).
loop_device_open() returns it in all cases.

Hence, let's clean this up, and make sure in all success code paths of
both functions we return it (even though it strictly speaking is
redundant, since we return it in LoopDevice anyway, and currently noone
actually relies on this).
This commit is contained in:
Lennart Poettering 2021-04-20 10:46:34 +02:00
parent 02ef01ade3
commit 38bd449f96

View File

@ -441,7 +441,7 @@ int loop_device_make(
};
*ret = d;
return 0;
return d->fd;
}
int loop_device_make_by_path(const char *path, int open_flags, uint32_t loop_flags, LoopDevice **ret) {