diff options
author | Alexander Kuleshov <kuleshovmail@gmail.com> | 2016-07-02 23:38:47 +0600 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-06-16 10:13:01 +0200 |
commit | 4617cac05930a787af45714682402edf7dac62a9 (patch) | |
tree | 53cd31863a1e5d3226b213e538b45444280200e7 /src/basic/fd-util.h | |
parent | 5fe94801a659675f35b52f974942fb7ee9b8f3fc (diff) |
basic/fd-util: introduce stdio_unset_cloexec() function
There are some places in the elogind which are use the same pattern:
fd_cloexec(STDIN_FILENO, false);
fd_cloexec(STDOUT_FILENO, false);
fd_cloexec(STDERR_FILENO, false);
to unset CLOEXEC for standard file descriptors. This patch introduces
the stdio_unset_cloexec() function to hide this and make code cleaner.
Diffstat (limited to 'src/basic/fd-util.h')
-rw-r--r-- | src/basic/fd-util.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h index 522ea6894..fe92b76c4 100644 --- a/src/basic/fd-util.h +++ b/src/basic/fd-util.h @@ -65,6 +65,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(DIR*, closedir); int fd_nonblock(int fd, bool nonblock); int fd_cloexec(int fd, bool cloexec); +void stdio_unset_cloexec(void); int close_all_fds(const int except[], unsigned n_except); |