]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-event: set O_CLOEXEC to pipe fds
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 23 Oct 2018 01:18:36 +0000 (10:18 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 23 Oct 2018 19:46:48 +0000 (04:46 +0900)
src/udev/udev-event.c

index 55ab625ca0e2cf0491cf6f2b435acea45a7b100d..18cea2fc2178b016e67e4dd1d81ee0ac0464b1a5 100644 (file)
@@ -661,11 +661,11 @@ int udev_event_spawn(struct udev_event *event,
 
         /* pipes from child to parent */
         if (!result || log_get_max_level() >= LOG_INFO)
-                if (pipe2(outpipe, O_NONBLOCK) != 0)
+                if (pipe2(outpipe, O_NONBLOCK|O_CLOEXEC) != 0)
                         return log_error_errno(errno, "Failed to create pipe for command '%s': %m", cmd);
 
         if (log_get_max_level() >= LOG_INFO)
-                if (pipe2(errpipe, O_NONBLOCK) != 0)
+                if (pipe2(errpipe, O_NONBLOCK|O_CLOEXEC) != 0)
                         return log_error_errno(errno, "Failed to create pipe for command '%s': %m", cmd);
 
         argv = strv_split_full(cmd, NULL, SPLIT_QUOTES|SPLIT_RELAX);