]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/home/homework-luks.c
homework: cleanup use of ERRNO_IS_DEVICE_ABSENT()
authorDmitry V. Levin <ldv@strace.io>
Fri, 14 Jul 2023 08:00:00 +0000 (08:00 +0000)
committerDmitry V. Levin <ldv@strace.io>
Fri, 28 Jul 2023 12:28:35 +0000 (12:28 +0000)
commit0d16fab986a2147292d466ddf3315ceafcae0eef
tree6323da3e8cc69a74474c51610c82aead1dd140f7
parent1553f9b1bc127eb21fc08a791d0a4a79e4a839ff
homework: cleanup use of ERRNO_IS_DEVICE_ABSENT()

Given that ERRNO_IS_DEVICE_ABSENT() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.

In this case the arguments passed to ERRNO_IS_DEVICE_ABSENT()
are the values returned by external cryptsetup functions
sym_crypt_init_by_name() and sym_crypt_deactivate_by_name() which are
not expected to return any positive values, but let's be consistent
anyway and move ERRNO_IS_DEVICE_ABSENT() invocations to the branches
where the return values are known to be negative.
src/home/homework-luks.c