]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 29 Oct 1998 17:48:35 +0000 (17:48 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 29 Oct 1998 17:48:35 +0000 (17:48 +0000)
* 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.

ChangeLog
sysdeps/unix/sysv/linux/ttyname.c
sysdeps/unix/sysv/linux/ttyname_r.c

index dc2ad0ab97e53a11a3ea32ae70e77121d3ea1ee3..8a622538e4222040ce2a869261193b8d41651b3b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 1998-10-29  Ulrich Drepper  <drepper@cygnus.com>
 
+       * 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.
+
        * nscd/nscd.c (doc): It's "Name Service" not "Name Switch".
 
        * malloc/mtrace.c (tr_where): Replace snprintf call by mempcpy and
index 40b006a8cde3b50dd607495b9bb508fa2bd9e3d4..35eb4b4696627f672c5076035c479899d03dcf17 100644 (file)
@@ -131,7 +131,9 @@ ttyname (fd)
        }
     }
 
-  if (__readlink (procname, buf, buflen) != -1)
+  if (__readlink (procname, buf, buflen) != -1
+      /* This is for Linux 2.0.  */
+      && buf[0] != '[')
     return buf;
 
   if (fstat (fd, &st) < 0)
index 8306cf56c0eac4c99ee8bdbf60ec263dea2be9bf..449942a96d8cd437ace5d3ab91dbbdb643432efe 100644 (file)
@@ -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;
This page took 0.048504 seconds and 5 git commands to generate.