From f8c02f38566d368935fbd09143e2f59450ef1e5f Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Fri, 7 Sep 2018 13:42:01 +0100
Subject: Yet more debug info.
---
Src/exec.c | 8 +-------
Src/signals.c | 5 +++++
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/Src/exec.c b/Src/exec.c
index d6e045770..3a125ef73 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1050,13 +1050,7 @@ entersubsh(int flags, struct entersubsh_ret *retp)
SETPGRP(0L, jobtab[list_pipe_job].gleader, 2);
if (!(flags & ESUB_ASYNC))
ATTACHTTY(jobtab[thisjob].gleader, 2);
- } else if (gettygrp() == GETPGRP()) {
- /*
- * There are races where if the process is attached
- * to the terminal blocking SIGTTOU causes errors.
- * So just leave signals alone.
- */
- /* job_control_ok = 1;*/ /* Probably not a * fix */
+ } else {
#ifdef DEBUG_JOB_CONTROL
fprintf(stderr, "pid = %d, gleader = %d, pgrp = %d, list_pipe_child = %d, mypgrp = %d\n",
getpid(), jobtab[list_pipe_job].gleader,
diff --git a/Src/signals.c b/Src/signals.c
index 0ffcd9dc4..36f0e1c8c 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -540,6 +540,11 @@ wait_for_processes(void)
if (WIFEXITED(status) &&
pn->pid == jn->gleader &&
killpg(pn->pid, 0) == -1) {
+#ifdef DEBUG_JOB_CONTROL
+ fprintf(stderr, "pid %d exited in control of TTY\n",
+ pn->pid);
+ fflush(stderr);
+#endif
SET_GLEADER(jn-jobtab, 0, 11);
if (!(jn->stat & STAT_NOSTTY)) {
/*
--
cgit 1.4.1