summaryrefslogtreecommitdiffstats
path: root/src/fsck
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-02-07 06:33:06 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-02-07 06:39:49 +0100
commitf3f2d02e9731e65eb15c26980305cd47e028f4fc (patch)
treea9658f0e205450dd16279d9881ed301fb3d0ab95 /src/fsck
parentudevd: configure a child process name for worker processes (diff)
downloadsystemd-f3f2d02e9731e65eb15c26980305cd47e028f4fc.tar.xz
systemd-f3f2d02e9731e65eb15c26980305cd47e028f4fc.zip
tree-wide: set FORK_RLIMIT_NOFILE_SAFE flag
No functional changes, just refactoring.
Diffstat (limited to 'src/fsck')
-rw-r--r--src/fsck/fsck.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
index 37fdfa540f..e25c5d5efa 100644
--- a/src/fsck/fsck.c
+++ b/src/fsck/fsck.c
@@ -27,7 +27,6 @@
#include "path-util.h"
#include "proc-cmdline.h"
#include "process-util.h"
-#include "rlimit-util.h"
#include "signal-util.h"
#include "socket-util.h"
#include "special.h"
@@ -346,7 +345,7 @@ static int run(int argc, char *argv[]) {
pipe(progress_pipe) < 0)
return log_error_errno(errno, "pipe(): %m");
- r = safe_fork("(fsck)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_LOG, &pid);
+ r = safe_fork("(fsck)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_LOG|FORK_RLIMIT_NOFILE_SAFE, &pid);
if (r < 0)
return r;
if (r == 0) {
@@ -395,8 +394,6 @@ static int run(int argc, char *argv[]) {
cmdline[i++] = device;
cmdline[i++] = NULL;
- (void) rlimit_nofile_safe();
-
execv(cmdline[0], (char**) cmdline);
_exit(FSCK_OPERATIONAL_ERROR);
}