]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/execute.c
fd-util: add new helper move_fd() and make use of it
authorLennart Poettering <lennart@poettering.net>
Thu, 26 Oct 2017 16:45:54 +0000 (18:45 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 17 Nov 2017 10:13:44 +0000 (11:13 +0100)
commit046a82c1b20f765a8aa704ddea87e1b906d8ded0
tree058313f8238fb73d6ab6baeb4a50d7c290410e44
parent05d69e0294b6bbc7aa348d4fd09bfa847b6e178a
fd-util: add new helper move_fd() and make use of it

We are using the same pattern at various places: call dup2() on an fd,
and close the old fd, usually in combination with some O_CLOEXEC
fiddling. Let's add a little helper for this, and port a few obvious
cases over.
src/basic/fd-util.c
src/basic/fd-util.h
src/core/execute.c
src/import/import-common.c
src/import/pull-common.c