about summary refs log tree commit diff
path: root/Src/signals.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2020-02-27 20:42:16 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2020-02-27 20:42:16 +0000
commit14ea665a903b26a658ef1d2ca974a9b48e09eff1 (patch)
tree443a5225cfac4052123b81c4d7c5b7ee5a5220c7 /Src/signals.c
parentfe516fccb4754833f850cb62f6607226370bbf53 (diff)
downloadzsh-14ea665a903b26a658ef1d2ca974a9b48e09eff1.tar.gz
zsh-14ea665a903b26a658ef1d2ca974a9b48e09eff1.tar.xz
zsh-14ea665a903b26a658ef1d2ca974a9b48e09eff1.zip
users/24710: Fix job control problem with sudo.
If we use kill to test for continued existence of a process group,
we should check on failure that the error is ESRCH, as EPERM
indicates the group still has memebers but running privileged
so should be left alone.
Diffstat (limited to 'Src/signals.c')
-rw-r--r--Src/signals.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/signals.c b/Src/signals.c
index 96ff9e9b3..4adf03202 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -539,7 +539,8 @@ wait_for_processes(void)
 #endif
 		if (WIFEXITED(status) &&
 		    pn->pid == jn->gleader &&
-		    killpg(pn->pid, 0) == -1) {
+		    killpg(pn->pid, 0) == -1  &&
+		    errno == ESRCH) {
 		    if (last_attached_pgrp == jn->gleader &&
 			!(jn->stat & STAT_NOSTTY)) {
 			/*