diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-07-02 15:22:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-02 15:22:14 -0700 |
commit | b1e67dfe31c6911820eac753f6461e1c9a00f26c (patch) | |
tree | 253c67693fe1b4897d92b90b994d3ae60c0ddecf /src/import/import-common.c | |
parent | e71af7931616601159f50c9029efc07ec347d73b (diff) | |
parent | 913f38e4402ad19529b13fdb56db77eaa2b9f30a (diff) |
Merge pull request #3641 from 0xAX/unset-cloexec-for-stdfs
basic/fd-util: introduce stdio_unset_cloexec() function
Diffstat (limited to 'src/import/import-common.c')
-rw-r--r-- | src/import/import-common.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/import/import-common.c b/src/import/import-common.c index 287a3382a1..81209cdaf6 100644 --- a/src/import/import-common.c +++ b/src/import/import-common.c @@ -125,9 +125,7 @@ int import_fork_tar_x(const char *path, pid_t *ret) { if (null_fd != STDOUT_FILENO) null_fd = safe_close(null_fd); - fd_cloexec(STDIN_FILENO, false); - fd_cloexec(STDOUT_FILENO, false); - fd_cloexec(STDERR_FILENO, false); + stdio_unset_cloexec(); if (unshare(CLONE_NEWNET) < 0) log_error_errno(errno, "Failed to lock tar into network namespace, ignoring: %m"); @@ -199,9 +197,7 @@ int import_fork_tar_c(const char *path, pid_t *ret) { if (null_fd != STDIN_FILENO) null_fd = safe_close(null_fd); - fd_cloexec(STDIN_FILENO, false); - fd_cloexec(STDOUT_FILENO, false); - fd_cloexec(STDERR_FILENO, false); + stdio_unset_cloexec(); if (unshare(CLONE_NEWNET) < 0) log_error_errno(errno, "Failed to lock tar into network namespace, ignoring: %m"); |