diff options
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/pthread_kill.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/pthread_kill.c b/nptl/sysdeps/unix/sysv/linux/pthread_kill.c index e1c79e79b3..ca6dfd887a 100644 --- a/nptl/sysdeps/unix/sysv/linux/pthread_kill.c +++ b/nptl/sysdeps/unix/sysv/linux/pthread_kill.c @@ -36,9 +36,10 @@ __pthread_kill (threadid, signo) /* The kernel returns EINVAL for PIDs <= 0. This is not nice since the user would expect ESRCH. Correct it here. */ - int val = (pd->tid > 0 - ? INTERNAL_SYSCALL (tkill, err, 2, pd->tid, signo) - : ESRCH); + if (pd->tid <= 0) + return ESRCH; + + int val = INTERNAL_SYSCALL (tkill, err, 2, pd->tid, signo); return (INTERNAL_SYSCALL_ERROR_P (val, err) ? INTERNAL_SYSCALL_ERRNO (val, err) : 0); |