]> git.ipfire.org Git - thirdparty/systemd.git/commit
tree-wide: always use TAKE_FD() when calling rearrange_stdio()
authorLennart Poettering <lennart@poettering.net>
Tue, 2 Nov 2021 14:50:55 +0000 (15:50 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 3 Nov 2021 23:05:26 +0000 (23:05 +0000)
commitaedec452b9e5dd197881f2164fb205dfe8bfdcec
tree551d116509319e98aa5f4a6e4f792a95af7c38bf
parent829b86bc0fa2b6bf68ee90b33b0382b71f96f6f6
tree-wide: always use TAKE_FD() when calling rearrange_stdio()

rearrange_stdio() invalidates specified fds even on failure, which means
we should always invalidate the fds we pass in no matter what. Let's
make this explicit by using TAKE_FD() for that everywhere.

Note that in many places we such invalidation doesnt get us much
behaviour-wise, since we don't use the variables anymore later. But
TAKE_FD() in a way is also documentation, it encodes explicitly that the
fds are invalidated here, so I think it's a good thing to always make
this explicit here.
src/core/execute.c
src/home/homed-home.c
src/import/import-common.c
src/import/importd.c
src/import/pull-common.c
src/journal-remote/journal-remote-main.c
src/libsystemd/sd-bus/bus-socket.c
src/nspawn/nspawn-setuid.c
src/shared/exec-util.c
src/test/test-execute.c
src/udev/udev-event.c