about summary refs log tree commit diff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-02-18 21:04:15 +0000
committerUlrich Drepper <drepper@redhat.com>2003-02-18 21:04:15 +0000
commit2f7dc59492a588a9b196c13a519fb5f2e42c274d (patch)
treef72fb330f6939009c95b08d23ca26e45b7b68ab1 /nptl/sysdeps
parentba25bb0f1d140994dc0b6ee5f074d1237c493ee5 (diff)
downloadglibc-2f7dc59492a588a9b196c13a519fb5f2e42c274d.tar.gz
glibc-2f7dc59492a588a9b196c13a519fb5f2e42c274d.tar.xz
glibc-2f7dc59492a588a9b196c13a519fb5f2e42c274d.zip
Update.
2003-02-18  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Recognize
	invalid file descriptors and missing access permissions.
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/pthread_kill.c7
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);