From 2f7dc59492a588a9b196c13a519fb5f2e42c274d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 18 Feb 2003 21:04:15 +0000 Subject: Update. 2003-02-18 Ulrich Drepper * sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Recognize invalid file descriptors and missing access permissions. --- nptl/sysdeps/unix/sysv/linux/pthread_kill.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nptl/sysdeps/unix/sysv/linux/pthread_kill.c') 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); -- cgit 1.4.1