summaryrefslogtreecommitdiffstats
path: root/src/subprocess-posix.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2016-03-05 01:51:06 (GMT)
committerNico Weber <nicolasweber@gmx.de>2016-03-05 02:17:09 (GMT)
commite605fcc8ea91487e1653444ecf63f5597261f17c (patch)
tree67df569dd00fb5a050f484edb83d731b8495fe29 /src/subprocess-posix.cc
parentd63fe50c493c397bae3b4a3dd08cfac128000a81 (diff)
downloadNinja-e605fcc8ea91487e1653444ecf63f5597261f17c.zip
Ninja-e605fcc8ea91487e1653444ecf63f5597261f17c.tar.gz
Ninja-e605fcc8ea91487e1653444ecf63f5597261f17c.tar.bz2
Revert #910.
The change caused some issues (it makes it impossible ot use posix_spawn() and makes it harder to suspend children on ctrl-z). After discussing with jln: Since it fixes a corner case that can be fixed by explicitly running commands that need it in a wrapper that setsid()s them, let's try reverting it for a while. Please shout if this is a problem for you. See also #1097.
Diffstat (limited to 'src/subprocess-posix.cc')
-rw-r--r--src/subprocess-posix.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc
index 2ddc709..ae7ae6f 100644
--- a/src/subprocess-posix.cc
+++ b/src/subprocess-posix.cc
@@ -70,11 +70,8 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
break;
if (!use_console_) {
- // Put the child in its own session and process group. It will be
- // detached from the current terminal and ctrl-c won't reach it.
- // Since this process was just forked, it is not a process group leader
- // and setsid() will succeed.
- if (setsid() < 0)
+ // Put the child in its own process group, so ctrl-c won't reach it.
+ if (setpgid(0, 0) < 0)
break;
// Open /dev/null over stdin.