Partial reversion of rev 1.138. kill and killpg allow a signal

argument of 0.  You cannot return EINVAL for signal 0.  This broke
(in 5 minutes of testing) at least ssh-agent and screen.

However, there was a bug in the original code.  Signal 128 is not
valid.

Pointy-hat to: des, jhb
This commit is contained in:
peter 2001-11-03 12:36:16 +00:00
parent c6127e6abf
commit 43929480b6

View File

@ -1053,7 +1053,7 @@ kill(td, uap)
register struct proc *p;
int error = 0;
if (!_SIG_VALID(uap->signum))
if ((u_int)uap->signum >= _SIG_MAXSIG)
return (EINVAL);
mtx_lock(&Giant);
@ -1105,7 +1105,7 @@ okillpg(td, uap)
{
int error;
if (!_SIG_VALID(uap->signum))
if ((u_int)uap->signum >= _SIG_MAXSIG)
return (EINVAL);
mtx_lock(&Giant);
error = killpg1(td->td_proc, uap->signum, uap->pgid, 0);