From b2862e82ee425ae93aff6a337d249f756885888b Mon Sep 17 00:00:00 2001
From: KO Myung-Hun <komh@chollian.net>
Date: Fri, 3 Jul 2015 19:46:14 +0900
Subject: [PATCH] OS/2: do not pass write_fd to the child
This causes the server shell to be frozen even if kill()ed on OS/2.
---
fixincludes/procopen.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fixincludes/procopen.c b/fixincludes/procopen.c
index 22d4f67..272eaff 100644
--- a/fixincludes/procopen.c
+++ b/fixincludes/procopen.c
@@ -189,6 +189,9 @@ proc2_open (t_fd_pair* p_pair, tCC** pp_args)
if (pipe ((int *) p_pair) < 0)
return NOPROCESS;
+ /* Do not pass write_fd to the child */
+ fcntl(p_pair->write_fd, F_SETFD, FD_CLOEXEC);
+
p_pair->read_fd = chain_open (p_pair->read_fd, pp_args, &ch_id);
if (ch_id == NOPROCESS)
close (p_pair->write_fd);
--
1.9.5
sh does not quit even if build is finished.
Here is the patch.