1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
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.
This commit is contained in:
Ulrich Drepper
2003-02-18 21:04:15 +00:00
parent ba25bb0f1d
commit 2f7dc59492
6 changed files with 105 additions and 13 deletions

View File

@ -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);