about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.stephenson@samsung.com>2018-09-07 11:16:23 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2018-09-16 17:42:32 +0100
commitb470d6fa709b3afbd4f2f4448ab289ec5a300a73 (patch)
tree686f493d64898c3ddf83f947bddf22d36df3921d /Src/utils.c
parentefe470254cce0a2805e899ab4afe7188018c22dc (diff)
downloadzsh-b470d6fa709b3afbd4f2f4448ab289ec5a300a73.tar.gz
zsh-b470d6fa709b3afbd4f2f4448ab289ec5a300a73.tar.xz
zsh-b470d6fa709b3afbd4f2f4448ab289ec5a300a73.zip
Add some more debug.
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 42f6ab773..342e31f53 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -4651,8 +4651,9 @@ attachtty(pid_t pgrp
 
     if (jobbing && interact) {
 #ifdef DEBUG_JOB_CONTROL
-	fprintf(stderr, "attachtty(%d): pgrp = %d, mypgrp = %d\n",
-		index, pgrp, mypgrp);
+	fprintf(stderr, "attachtty(%d): pgrp = %d, mypgrp = %d, curpid = %d\n",
+		index, pgrp, mypgrp, getpid());
+	fflush(stderr);
 #endif
 #ifdef HAVE_TCSETPGRP
 	if (SHTTY != -1 && tcsetpgrp(SHTTY, pgrp) == -1 && !ep)
@@ -4668,6 +4669,7 @@ attachtty(pid_t pgrp
 	{
 #ifdef DEBUG_JOB_CONTROL
 	    fprintf(stderr, "attachtty failed\n");
+	    fflush(stderr);
 #endif
 	    if (pgrp != mypgrp && kill(-pgrp, 0) == -1)
 		ATTACHTTY(mypgrp, 16);
@@ -4690,15 +4692,9 @@ attachtty(pid_t pgrp
 void set_gleader(int job, int pid, int index)
 {
     jobtab[job].gleader = pid;
-    fprintf(stderr, "set_gleader(%d): %d = %d\n", index, job, pid);
-}
-
-int setpgrp_debug(int pid, int pgid, int index)
-{
-    int ret = setpgrp(pid, pgid);
-    fprintf(stderr, "setpgrp(%d): pid %d, pgid %d, current pid %d, ret %d\n",
-	    index, pid, pgid, getpid(), ret);
-    return ret;
+    fprintf(stderr, "set_gleader(%d): %d = %d, curpid = %d\n", index, job, pid,
+	getpid());
+    fflush(stderr);
 }
 
 /**/