]> git.ipfire.org Git - thirdparty/systemd.git/commit
fs-util: make laccess() macro follow our usual error propagation
authorLennart Poettering <lennart@poettering.net>
Fri, 15 Jan 2021 13:54:11 +0000 (14:54 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 15 Jan 2021 19:14:10 +0000 (19:14 +0000)
commit41979f59d38cda73c61edd5cc25ee543921032f3
tree309ff5b73a5e52ac90f38994b9ac58d9e64bcd1e
parent064b8e2c99ceb348c515353cc5c7d7bd05c49fcb
fs-util: make laccess() macro follow our usual error propagation

Functions defined by us are supposed to return negative errno-style
errors on errors. laccess() is for access() what lstat() is for stat(),
but defined by us as a macro. This led to some confusion regarding error
handling.

Let's return a negative errno code just in case. This means callers can
it use either way: like access(), i.e. checking for a negative return
value + looking at errno, or like our own code, i.e. using the negative
errno code it returns.
src/basic/fs-util.h