hrev51516 adds 1 changeset to branch 'master'
old head: 5623698f55b94d0bd88e8fb1ff07d7a8e4cd86cb
new head: 04dabcfdf37ce626d64e0ab908f2645086761c39
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=04dabcfdf37c+%5E5623698f55b9
----------------------------------------------------------------------------
04dabcfdf37c: posix_spawn(): close the pipe read fd in the parent.
* also enable close-on-exec for the eventually dupped pipe write fd in the
child.
[ Jérôme Duval <jerome.duval@xxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev51516
Commit: 04dabcfdf37ce626d64e0ab908f2645086761c39
URL: http://cgit.haiku-os.org/haiku/commit/?id=04dabcfdf37c
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Fri Nov 3 22:03:06 2017 UTC
----------------------------------------------------------------------------
1 file changed, 2 insertions(+)
src/system/libroot/posix/spawn.cpp | 2 ++
----------------------------------------------------------------------------
diff --git a/src/system/libroot/posix/spawn.cpp
b/src/system/libroot/posix/spawn.cpp
index 171e531..972f946 100644
--- a/src/system/libroot/posix/spawn.cpp
+++ b/src/system/libroot/posix/spawn.cpp
@@ -387,6 +387,7 @@ process_file_actions(const posix_spawn_file_actions_t
*_actions, int *errfd)
if (newfd == -1)
return errno;
close(action->fd);
+ fcntl(newfd, F_SETFD, FD_CLOEXEC);
*errfd = newfd;
}
@@ -443,6 +444,7 @@ do_posix_spawn(pid_t *_pid, const char *path,
read(fds[0], &err, sizeof(err));
if (err != 0)
waitpid(pid, NULL, WNOHANG);
+ close(fds[0]);
return err;
}