mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-21 13:00:57 +01:00
zsh-workers/7584
This commit is contained in:
parent
b785e1b02f
commit
5d25a9b2c4
3 changed files with 11 additions and 28 deletions
|
|
@ -835,11 +835,7 @@ waitforpid(pid_t pid)
|
|||
|
||||
/* child_block() around this loop in case #ifndef WNOHANG */
|
||||
child_block(); /* unblocked in child_suspend() */
|
||||
#ifdef BROKEN_KILL_ESRCH
|
||||
while (!errflag && (kill(pid, 0) >= 0 || (errno != ESRCH && errno != EINVAL))) {
|
||||
#else /* not BROKEN_KILL_ESRCH */
|
||||
while (!errflag && (kill(pid, 0) >= 0 || errno != ESRCH)) {
|
||||
#endif /* BROKEN_KILL_ESRCH */
|
||||
if (first)
|
||||
first = 0;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -593,38 +593,23 @@ killjb(Job jn, int sig)
|
|||
for (pn = jobtab[jn->other].procs; pn; pn = pn->next)
|
||||
if (killpg(pn->pid, sig) == -1)
|
||||
if (kill(pn->pid, sig) == -1 && errno != ESRCH)
|
||||
#ifdef BROKEN_KILL_ESRCH
|
||||
if(errno != EINVAL || sig != 0)
|
||||
#endif /* BROKEN_KILL_ESRCH */
|
||||
err = -1;
|
||||
err |= -1;
|
||||
|
||||
for (pn = jn->procs; pn->next; pn = pn->next)
|
||||
if (kill(pn->pid, sig) == -1 && errno != ESRCH)
|
||||
#ifdef BROKEN_KILL_ESRCH
|
||||
if(errno != EINVAL || sig != 0)
|
||||
#endif /* BROKEN_KILL_ESRCH */
|
||||
err = -1;
|
||||
err |= -1;
|
||||
|
||||
if (!jobtab[jn->other].procs && pn)
|
||||
if (kill(pn->pid, sig) == -1 && errno != ESRCH)
|
||||
#ifdef BROKEN_KILL_ESRCH
|
||||
if(errno != EINVAL || sig != 0)
|
||||
#endif /* BROKEN_KILL_ESRCH */
|
||||
err = -1;
|
||||
err |= -1;
|
||||
|
||||
return err;
|
||||
}
|
||||
if (killpg(jobtab[jn->other].gleader, sig) == -1 && errno != ESRCH)
|
||||
#ifdef BROKEN_KILL_ESRCH
|
||||
if(errno != EINVAL || sig != 0)
|
||||
#endif /* BROKEN_KILL_ESRCH */
|
||||
err = -1;
|
||||
|
||||
if (killpg(jn->gleader, sig) == -1 && errno != ESRCH)
|
||||
#ifdef BROKEN_KILL_ESRCH
|
||||
if(errno != EINVAL || sig != 0)
|
||||
#endif /* BROKEN_KILL_ESRCH */
|
||||
err = -1;
|
||||
err |= -1;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
@ -632,10 +617,7 @@ killjb(Job jn, int sig)
|
|||
return killpg(jn->gleader, sig);
|
||||
}
|
||||
for (pn = jn->procs; pn; pn = pn->next)
|
||||
if ((err = kill(pn->pid, sig)) == -1 && errno != ESRCH)
|
||||
#ifdef BROKEN_KILL_ESRCH
|
||||
if(errno != EINVAL || sig != 0)
|
||||
#endif /* BROKEN_KILL_ESRCH */
|
||||
if ((err = kill(pn->pid, sig)) == -1 && errno != ESRCH && sig != 0)
|
||||
return -1;
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -620,3 +620,8 @@ extern short ospeed;
|
|||
#ifdef BROKEN_TCSETPGRP
|
||||
#undef JOB_CONTROL
|
||||
#endif /* BROKEN_TCSETPGRP */
|
||||
|
||||
#ifdef BROKEN_KILL_ESRCH
|
||||
#undef ESRCH
|
||||
#define ESRCH EINVAL
|
||||
#endif /* BROKEN_KILL_ESRCH */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue