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.25-418-g8f0a947


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  8f0a947cf55f3b0c4ebdf06953c57eff67a22fa9 (commit)
      from  fdc543919a3d8578631a492e1227c2cd8f5ecec7 (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8f0a947cf55f3b0c4ebdf06953c57eff67a22fa9

commit 8f0a947cf55f3b0c4ebdf06953c57eff67a22fa9
Author: Arjun Shankar <arjun.is@lostca.se>
Date:   Mon May 29 16:12:31 2017 +0200

    Remove check for NULL buffer passed to `ptsname_r'
    
    `ptsname_r' is declared in stdlib.h to only accept a `nonnull'
    second argument and therefore GCC may choose to make optimizations
    based on the assumption that this argument is NULL. This means
    that potentially, GCC can optimize away the NULL check at some
    point in the future. Since this is a programming interface, we
    might as well remove the NULL check ourselves.
    
    This also warrants a change to the `ptsname_r' manual page that
    must be submitted to the corresponding mailing list.
    
    In addition, remove the NULL buffer test in login/tst-ptsname.c.

diff --git a/ChangeLog b/ChangeLog
index f74004b..4c06d7e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2017-06-07  Arjun Shankar  <arjun.is@lostca.se>
 
+	* sysdeps/unix/sysv/linux/ptsname.c (__ptsname_internal):
+	Remove check for NULL 'buf'.
+	* login/tst-ptsname.c (do_test): Remove test with NULL 'buf'.
+
+2017-06-07  Arjun Shankar  <arjun.is@lostca.se>
+
 	* sysdeps/unix/sysv/linux/tst-clone2.c: Do not
 	include test-skeleton.c.
 	Include support/check.h and support/test-driver.c.
diff --git a/login/tst-ptsname.c b/login/tst-ptsname.c
index be8744d..96f0449 100644
--- a/login/tst-ptsname.c
+++ b/login/tst-ptsname.c
@@ -70,7 +70,6 @@ do_test (void)
   if (fd != -1)
     {
       result |= do_single_test (fd, buf, sizeof (buf), 0);
-      result |= do_single_test (fd, NULL, sizeof (buf), EINVAL);
       result |= do_single_test (fd, buf, 1, ERANGE);
       close (fd);
     }
diff --git a/sysdeps/unix/sysv/linux/ptsname.c b/sysdeps/unix/sysv/linux/ptsname.c
index e3f2ae8..41bb0bb 100644
--- a/sysdeps/unix/sysv/linux/ptsname.c
+++ b/sysdeps/unix/sysv/linux/ptsname.c
@@ -72,12 +72,6 @@ __ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp)
   int save_errno = errno;
   unsigned int ptyno;
 
-  if (buf == NULL)
-    {
-      __set_errno (EINVAL);
-      return EINVAL;
-    }
-
   if (!__isatty (fd))
     {
       __set_errno (ENOTTY);

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

Summary of changes:
 ChangeLog                         |    6 ++++++
 login/tst-ptsname.c               |    1 -
 sysdeps/unix/sysv/linux/ptsname.c |    6 ------
 3 files changed, 6 insertions(+), 7 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]