mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
* sysdeps/unix/sysv/linux/ttyname.c (ttyname): Keep Linux 2.0 kernels in mind when reading /proc/self/fd/FD. * sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Likewise.
This commit is contained in:
@ -134,9 +134,9 @@ __ttyname_r (fd, buf, buflen)
|
||||
*_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';
|
||||
|
||||
ret = __readlink (procname, buf, buflen - 1);
|
||||
if (ret != -1)
|
||||
if (ret != -1 && buf[0] != '[')
|
||||
return 0;
|
||||
if (errno == ENAMETOOLONG)
|
||||
if (ret == -1 && errno == ENAMETOOLONG)
|
||||
{
|
||||
__set_errno (ERANGE);
|
||||
return ERANGE;
|
||||
|
Reference in New Issue
Block a user