diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-02-07 14:33:06 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-02-07 14:39:49 +0900 |
commit | f3f2d02e9731e65eb15c26980305cd47e028f4fc (patch) | |
tree | a9658f0e205450dd16279d9881ed301fb3d0ab95 /src/journal-remote | |
parent | e955a7f460adadf54da7bfb62f04cbff16ca5941 (diff) | |
download | systemd-f3f2d02e9731e65eb15c26980305cd47e028f4fc.tar.gz |
tree-wide: set FORK_RLIMIT_NOFILE_SAFE flag
No functional changes, just refactoring.
Diffstat (limited to 'src/journal-remote')
-rw-r--r-- | src/journal-remote/journal-remote-main.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c index 29f05891f5..7df264fb53 100644 --- a/src/journal-remote/journal-remote-main.c +++ b/src/journal-remote/journal-remote-main.c @@ -85,7 +85,7 @@ static int spawn_child(const char* child, char** argv) { if (pipe(fd) < 0) return log_error_errno(errno, "Failed to create pager pipe: %m"); - r = safe_fork("(remote)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_LOG, &child_pid); + r = safe_fork("(remote)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_LOG|FORK_RLIMIT_NOFILE_SAFE, &child_pid); if (r < 0) { safe_close_pair(fd); return r; @@ -101,8 +101,6 @@ static int spawn_child(const char* child, char** argv) { _exit(EXIT_FAILURE); } - (void) rlimit_nofile_safe(); - execvp(child, argv); log_error_errno(errno, "Failed to exec child %s: %m", child); _exit(EXIT_FAILURE); |