This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.16-ports-merge-267-g050af9c


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  050af9c4e86eeecd484ed44b7765e750523276eb (commit)
      from  ad845c0be95fe3635af0147f0665b110286e68a5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=050af9c4e86eeecd484ed44b7765e750523276eb

commit 050af9c4e86eeecd484ed44b7765e750523276eb
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Aug 29 10:03:39 2012 +0530

    Don't make ttyname* fail if proc filesystem is not available
    
    The ttyname and ttyname_r functions on Linux now fall back to
    searching for the tty file descriptor in /dev/pts or /dev if /proc is
    not available.  This allows creation of chroots without the procfs
    mounted on /proc.
    
    Fixes BZ #14516.

diff --git a/ChangeLog b/ChangeLog
index f72f4b4..2490456 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-08-29  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	[BZ #14516]
+	* sysdeps/unix/sysv/linux/ttyname.c (ttyname): Don't return
+	failure if reading from procfs failed.
+	* sysdeps/unix/sysv/linux/ttyname_r.c (ttyname_r): Likewise.
+
 2012-08-27  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/kernel-features.h
diff --git a/NEWS b/NEWS
index 2471390..6abc6ea 100644
--- a/NEWS
+++ b/NEWS
@@ -12,7 +12,7 @@ Version 2.17
   3479, 5400, 6778, 6808, 9685, 11607, 13717, 13696, 13939, 14042, 14090,
   14166, 14150, 14151, 14154, 14157, 14166, 14173, 14195, 14252, 14283,
   14298, 14303, 14307, 14328, 14331, 14336, 14337, 14347, 14349, 14459,
-  14505, 14519
+  14505, 14516, 14519
 
 * Support for STT_GNU_IFUNC symbols added for s390 and s390x.
   Optimized versions of memcpy, memset, and memcmp added for System z10 and
@@ -40,6 +40,10 @@ Version 2.17
   New configure option --disable-build-nscd avoids building nscd itself;
   this is the default if --disable-nscd is used.
 
+* The ttyname and ttyname_r functions on Linux now fall back to searching for
+  the tty file descriptor in /dev/pts or /dev if /proc is not available.  This
+  allows creation of chroots without the procfs mounted on /proc.
+
 
 Version 2.16
 
diff --git a/sysdeps/unix/sysv/linux/ttyname.c b/sysdeps/unix/sysv/linux/ttyname.c
index 3dacd40..d3070c3 100644
--- a/sysdeps/unix/sysv/linux/ttyname.c
+++ b/sysdeps/unix/sysv/linux/ttyname.c
@@ -148,12 +148,6 @@ ttyname (int fd)
     }
 
   ssize_t len = __readlink (procname, ttyname_buf, buflen);
-  if (__builtin_expect (len == -1 && errno == ENOENT, 0))
-    {
-      __set_errno (EBADF);
-      return NULL;
-    }
-
   if (__builtin_expect (len != -1, 1))
     {
       if ((size_t) len >= buflen)
diff --git a/sysdeps/unix/sysv/linux/ttyname_r.c b/sysdeps/unix/sysv/linux/ttyname_r.c
index 2dd6781..211ed18 100644
--- a/sysdeps/unix/sysv/linux/ttyname_r.c
+++ b/sysdeps/unix/sysv/linux/ttyname_r.c
@@ -128,12 +128,6 @@ __ttyname_r (int fd, char *buf, size_t buflen)
   *_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';
 
   ssize_t ret = __readlink (procname, buf, buflen - 1);
-  if (__builtin_expect (ret == -1 && errno == ENOENT, 0))
-    {
-      __set_errno (EBADF);
-      return EBADF;
-    }
-
   if (__builtin_expect (ret == -1 && errno == ENAMETOOLONG, 0))
     {
       __set_errno (ERANGE);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                           |    7 +++++++
 NEWS                                |    6 +++++-
 sysdeps/unix/sysv/linux/ttyname.c   |    6 ------
 sysdeps/unix/sysv/linux/ttyname_r.c |    6 ------
 4 files changed, 12 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]