From 14ea665a903b26a658ef1d2ca974a9b48e09eff1 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 27 Feb 2020 20:42:16 +0000 Subject: 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. --- Src/signals.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Src/signals.c') 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)) { /* -- cgit 1.4.1