From f3f2d02e9731e65eb15c26980305cd47e028f4fc Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 7 Feb 2023 14:33:06 +0900 Subject: tree-wide: set FORK_RLIMIT_NOFILE_SAFE flag No functional changes, just refactoring. --- src/udev/udev-event.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/udev') diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index 6d47a2a49d..ec4ad30824 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -23,7 +23,6 @@ #include "parse-util.h" #include "path-util.h" #include "process-util.h" -#include "rlimit-util.h" #include "signal-util.h" #include "stdio-util.h" #include "string-util.h" @@ -811,7 +810,7 @@ int udev_event_spawn( log_device_debug(event->dev, "Starting '%s'", cmd); - r = safe_fork("(spawn)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_LOG, &pid); + r = safe_fork("(spawn)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_LOG|FORK_RLIMIT_NOFILE_SAFE, &pid); if (r < 0) return log_device_error_errno(event->dev, r, "Failed to fork() to execute command '%s': %m", cmd); @@ -820,7 +819,6 @@ int udev_event_spawn( _exit(EXIT_FAILURE); (void) close_all_fds(NULL, 0); - (void) rlimit_nofile_safe(); DEVICE_TRACE_POINT(spawn_exec, event->dev, cmd); -- cgit v1.2.3