]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/tmpfiles/tmpfiles.c
tmpfiles: take error code from "errno" earlier
authorLennart Poettering <lennart@poettering.net>
Fri, 8 Jul 2022 08:00:20 +0000 (10:00 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 8 Jul 2022 14:11:20 +0000 (16:11 +0200)
commit05c4affe04b5592c5786e5313e3edd1f36b1aca8
tree3183cdd4e66d60a14f63abd724e53d0fcd65d13e
parent979055ba7342e0b5b6d3389f0f1aa3f175b4bcb1
tmpfiles: take error code from "errno" earlier

This uses RET_NERRNO to more quickly pull the error code we see into
"r" out of "errno".

This does not change anything really. The only reason to do this is
because it is harder to break this accidentally. The thing is that
"errno" is easily set as side-effect of arbitrary functions. Thus, if we
rely on it being set for long code paths, we need to make carefully sure
that no code in between calls any function that might corrupt it as
side-effect. As far as I can see we did get this right. Nonetheless, I
think we should just store the value in "r" instead, to make it easier
to maintain this in the long run, if more code is inserted one day, who
knows.
src/tmpfiles/tmpfiles.c