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.22-204-g2d8e36e


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  2d8e36e691f460aeeb3362fd44c71cafc7bb5852 (commit)
      from  74589f738efd72e07f759a4aabd2e32613aaefb8 (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=2d8e36e691f460aeeb3362fd44c71cafc7bb5852

commit 2d8e36e691f460aeeb3362fd44c71cafc7bb5852
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date:   Tue Sep 1 08:48:15 2015 -0700

    Fix BZ #18757.

diff --git a/ChangeLog b/ChangeLog
index e4ca925..cbcccac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2015-09-01  Paul Pluzhnikov  <ppluzhnikov@google.com>
 
+	[BZ #18757]
+	* libio/iofopncook.c (_IO_fopencookie): Set errno on failure.
+	* libio/test-fmemopen.c (do_bz18820): Extend the test to cover
+	BZ #18757.
+
+2015-09-01  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
 	* malloc/mtrace.pl: Filter out NULL entries.
 
 2015-09-01  Joseph Myers  <joseph@codesourcery.com>
diff --git a/NEWS b/NEWS
index e41919a..029d563 100644
--- a/NEWS
+++ b/NEWS
@@ -11,8 +11,9 @@ Version 2.23
 
   2898, 14341, 15786, 16141, 16517, 16519, 16520, 16734, 16973, 17787,
   17905, 18084, 18086, 18240, 18265, 18370, 18421, 18480, 18525, 18610,
-  18618, 18647, 18661, 18674, 18681, 18778, 18781, 18787, 18789, 18790,
-  18795, 18796, 18820, 18823, 18824, 18863, 18870, 18873, 18887.
+  18618, 18647, 18661, 18674, 18681, 18757, 18778, 18781, 18787, 18789,
+  18790, 18795, 18796, 18820, 18823, 18824, 18863, 18870, 18873, 18887.
+
 
 * The obsolete header <regexp.h> has been removed.  Programs that require
   this header must be updated to use <regex.h> instead.
diff --git a/libio/iofopncook.c b/libio/iofopncook.c
index b845d29..978a7fa 100644
--- a/libio/iofopncook.c
+++ b/libio/iofopncook.c
@@ -189,6 +189,7 @@ _IO_fopencookie (cookie, mode, io_functions)
       read_write = _IO_NO_READS|_IO_IS_APPENDING;
       break;
     default:
+      __set_errno (EINVAL);
       return NULL;
   }
   if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+'))
diff --git a/libio/test-fmemopen.c b/libio/test-fmemopen.c
index e8e757f..a62f664 100644
--- a/libio/test-fmemopen.c
+++ b/libio/test-fmemopen.c
@@ -19,6 +19,7 @@
 
 static char buffer[] = "foobar";
 
+#include <errno.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
@@ -30,6 +31,7 @@ do_bz18820 (void)
   char ch;
   FILE *stream;
 
+  errno = 0;
   stream = fmemopen (&ch, 1, "?");
   if (stream)
     {
@@ -37,6 +39,11 @@ do_bz18820 (void)
       fclose (stream);
       return 1;
     }
+  if (errno != EINVAL)
+    {
+      printf ("fmemopen: got %i, expected EINVAL (%i)\n", errno, EINVAL);
+      return 10;
+    }
 
   stream = fmemopen (NULL, 42, "?");
   if (stream)
@@ -46,6 +53,20 @@ do_bz18820 (void)
       return 2;
     }
 
+  errno = 0;
+  stream = fmemopen (NULL, ~0, "w");
+  if (stream)
+    {
+      printf ("fmemopen: expected NULL, got %p\n", stream);
+      fclose (stream);
+      return 3;
+    }
+  if (errno != ENOMEM)
+    {
+      printf ("fmemopen: got %i, expected ENOMEM (%i)\n", errno, ENOMEM);
+      return 20;
+    }
+
   return 0;
 }
 

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

Summary of changes:
 ChangeLog             |    7 +++++++
 NEWS                  |    5 +++--
 libio/iofopncook.c    |    1 +
 libio/test-fmemopen.c |   21 +++++++++++++++++++++
 4 files changed, 32 insertions(+), 2 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]