[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commits] r23972 - in /fsf/trunk/libc: ./ csu/ elf/ libio/ malloc/ manual/ math/ nscd/ stdlib/



Author: eglibc
Date: Tue Sep 10 00:02:32 2013
New Revision: 23972

Log:
Import glibc-mainline for 2013-09-10

Added:
    fsf/trunk/libc/malloc/tst-realloc.c
    fsf/trunk/libc/math/test-fpucw-ieee-static.c
    fsf/trunk/libc/math/test-fpucw-ieee.c
    fsf/trunk/libc/math/test-fpucw-static.c
Modified:
    fsf/trunk/libc/COPYING
    fsf/trunk/libc/COPYING.LIB
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/csu/init-first.c
    fsf/trunk/libc/elf/dl-support.c
    fsf/trunk/libc/libio/memstream.c
    fsf/trunk/libc/libio/wmemstream.c
    fsf/trunk/libc/malloc/Makefile
    fsf/trunk/libc/manual/string.texi
    fsf/trunk/libc/math/Makefile
    fsf/trunk/libc/math/test-fpucw.c
    fsf/trunk/libc/nscd/netgroupcache.c
    fsf/trunk/libc/stdlib/isomac.c

Modified: fsf/trunk/libc/COPYING
==============================================================================
--- fsf/trunk/libc/COPYING (original)
+++ fsf/trunk/libc/COPYING Tue Sep 10 00:02:32 2013
@@ -1,12 +1,12 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-			    Preamble
+                            Preamble
 
   The licenses for most software are designed to take away your
 freedom to share and change it.  By contrast, the GNU General Public
@@ -15,7 +15,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,8 +55,8 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
+
+                    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -255,7 +255,7 @@
 of preserving the free status of all derivatives of our free software and
 of promoting the sharing and reuse of software generally.
 
-			    NO WARRANTY
+                            NO WARRANTY
 
   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
@@ -277,9 +277,9 @@
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
 possible use to the public, the best way to achieve this is to make it
@@ -303,10 +303,9 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -336,5 +335,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.

Modified: fsf/trunk/libc/COPYING.LIB
==============================================================================
--- fsf/trunk/libc/COPYING.LIB (original)
+++ fsf/trunk/libc/COPYING.LIB Tue Sep 10 00:02:32 2013
@@ -1,9 +1,8 @@
-
                   GNU LESSER GENERAL PUBLIC LICENSE
                        Version 2.1, February 1999
 
  Copyright (C) 1991, 1999 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -23,8 +22,7 @@
 Free Software Foundation and other authors who decide to use it.  You
 can use it too, but we suggest you first think carefully about whether
 this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations
-below.
+strategy to use in any particular case, based on the explanations below.
 
   When we speak of free software, we are referring to freedom of use,
 not price.  Our General Public Licenses are designed to make sure that
@@ -57,7 +55,7 @@
 that what they have is not the original version, so that the original
 author's reputation will not be affected by problems that might be
 introduced by others.
-^L
+
   Finally, software patents pose a constant threat to the existence of
 any free program.  We wish to make sure that a company cannot
 effectively restrict the users of a free program by obtaining a
@@ -89,9 +87,9 @@
 special circumstances.
 
   For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it
-becomes a de-facto standard.  To achieve this, non-free programs must
-be allowed to use the library.  A more frequent case is that a free
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
 library does the same job as widely used non-free libraries.  In this
 case, there is little to gain by limiting the free library to free
 software only, so we use the Lesser General Public License.
@@ -113,7 +111,7 @@
 "work based on the library" and a "work that uses the library".  The
 former contains code derived from the library, whereas the latter must
 be combined with the library in order to run.
-^L
+
                   GNU LESSER GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
@@ -138,8 +136,8 @@
   "Source code" for a work means the preferred form of the work for
 making modifications to it.  For a library, complete source code means
 all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control
-compilation and installation of the library.
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
 
   Activities other than copying, distribution and modification are not
 covered by this License; they are outside its scope.  The act of
@@ -218,7 +216,7 @@
 ordinary GNU General Public License has appeared, then you can specify
 that version instead if you wish.)  Do not make any other change in
 these notices.
-^L
+
   Once this change is made in a given copy, it is irreversible for
 that copy, so the ordinary GNU General Public License applies to all
 subsequent copies and derivative works made from that copy.
@@ -269,7 +267,7 @@
 distribute the object code for the work under the terms of Section 6.
 Any executables containing that work also fall under Section 6,
 whether or not they are linked directly with the Library itself.
-^L
+
   6. As an exception to the Sections above, you may also combine or
 link a "work that uses the Library" with the Library to produce a
 work containing portions of the Library, and distribute that work
@@ -305,10 +303,10 @@
     the user installs one, as long as the modified version is
     interface-compatible with the version that the work was made with.
 
-    c) Accompany the work with a written offer, valid for at least
-    three years, to give the same user the materials specified in
-    Subsection 6a, above, for a charge no more than the cost of
-    performing this distribution.
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
 
     d) If distribution of the work is made by offering access to copy
     from a designated place, offer equivalent access to copy the above
@@ -331,7 +329,7 @@
 accompany the operating system.  Such a contradiction means you cannot
 use both them and the Library together in an executable that you
 distribute.
-^L
+
   7. You may place library facilities that are a work based on the
 Library side-by-side in a single library together with other library
 facilities not covered by this License, and distribute such a combined
@@ -372,7 +370,7 @@
 restrictions on the recipients' exercise of the rights granted herein.
 You are not responsible for enforcing compliance by third parties with
 this License.
-^L
+
   11. If, as a consequence of a court judgment or allegation of patent
 infringement or for any other reason (not limited to patent issues),
 conditions are imposed on you (whether by court order, agreement or
@@ -386,10 +384,9 @@
 the only way you could satisfy both it and this License would be to
 refrain entirely from distribution of the Library.
 
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply, and the section as a whole is intended to apply in other
-circumstances.
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
 
 It is not the purpose of this section to induce you to infringe any
 patents or other property right claims or to contest validity of any
@@ -407,11 +404,11 @@
 
   12. If the distribution and/or use of the Library is restricted in
 certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License
-may add an explicit geographical distribution limitation excluding those
-countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
 
   13. The Free Software Foundation may publish revised and/or new
 versions of the Lesser General Public License from time to time.
@@ -425,7 +422,7 @@
 the Free Software Foundation.  If the Library does not specify a
 license version number, you may choose any version ever published by
 the Free Software Foundation.
-^L
+
   14. If you wish to incorporate parts of the Library into other free
 programs whose distribution conditions are incompatible with these,
 write to the author to ask for permission.  For software which is
@@ -459,21 +456,19 @@
 DAMAGES.
 
                      END OF TERMS AND CONDITIONS
-^L
+
            How to Apply These Terms to Your New Libraries
 
   If you develop a new library, and you want it to be of the greatest
 possible use to the public, we recommend making it free software that
 everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms
-of the ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.
-It is safest to attach them to the start of each source file to most
-effectively convey the exclusion of warranty; and each file should
-have at least the "copyright" line and a pointer to where the full
-notice is found.
-
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
 
     <one line to give the library's name and a brief idea of what it does.>
     Copyright (C) <year>  <name of author>
@@ -490,21 +485,18 @@
 
     You should have received a copy of the GNU Lesser General Public
     License along with this library; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 Also add information on how to contact you by electronic and paper mail.
 
-You should also get your employer (if you work as a programmer) or
-your school, if any, to sign a "copyright disclaimer" for the library,
-if necessary.  Here is a sample; alter the names:
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
 
   Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James
-  Random Hacker.
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
 
   <signature of Ty Coon>, 1 April 1990
   Ty Coon, President of Vice
 
 That's all there is to it!
-
-

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue Sep 10 00:02:32 2013
@@ -1,3 +1,53 @@
+2013-09-09  Maciej W. Rozycki  <macro@xxxxxxxxxxxxxxxx>
+
+	* csu/init-first.c (_init): Remove the !SHARED condition around
+	FPU control word initialization.
+	* elf/dl-support.c (_dl_fpu_control): New variable.
+	(_dl_aux_init) <AT_FPUCW>: Initialize it.
+	* math/test-fpucw.c [!FPU_CONTROL] (FPU_CONTROL): New macro.
+	(main): Replace _FPU_DEFAULT with FPU_CONTROL throughout.
+	* math/test-fpucw-static.c: New file.
+	* math/test-fpucw-ieee.c: New file.
+	* math/test-fpucw-ieee-static.c: New file.
+	* math/Makefile (tests): Add `test-fpucw-ieee' and
+	`$(tests-static)'.
+	(tests-static): New variable.
+	[($(build-shared),yes)] ($(addprefix $(objpfx),$(tests))): Move
+	dependency to...
+	[($(build-shared),yes)]
+	($(addprefix $(objpfx),$(filter-out $(tests-static),$(tests)))):
+	... this.
+	[($(build-shared),yes)] ($(addprefix $(objpfx),$(tests-static))):
+	New dependency.
+
+2013-09-09  Allan McRae  <allan@xxxxxxxxxxxxx>
+
+	[BZ #15939]
+	* manual/string.texi (Collation Functions): Fix typo in
+	strcoll example.
+	Reported by Suren Karapetyan <me@xxxxxxxxxxxxxxxxxxxxx>.
+
+	[BZ #15893]
+	* stdlib/isomac.c (get_null_defines): Fix memory leak.
+
+	[BZ #15892]
+	* libio/memstream.c (open_memstream): Fix memory leak.
+	* libio/wmemstream.c (open_wmemstream): Likewise.
+
+	[BZ #15895]
+	* nscd/netgroupcache.c: Fix nesting of ifdefs.
+
+2013-09-09  Will Newton  <will.newton@xxxxxxxxxx>
+
+	* malloc/Makefile: Add tst-realloc to tests.
+	* malloc/tst-realloc.c: New file.
+
+2013-09-09  Allan McRae  <allan@xxxxxxxxxxxxx>
+
+	[BZ #15844]
+	* COPYING: Update from GNU website to fix FSF address.
+	* COPYING.LIB: Likewise.
+
 2013-09-06  David S. Miller  <davem@xxxxxxxxxxxxx>
 
 	* po/zh_TW.po: Update Chinese (traditional) translation from

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Tue Sep 10 00:02:32 2013
@@ -9,8 +9,9 @@
 
 * The following bugs are resolved with this release:
 
-  14155, 14699, 15427, 15522, 15531, 15532, 15736, 15749, 15797, 15867,
-  15886, 15887, 15890, 15897, 15905, 15909, 15921.
+  14155, 14699, 15427, 15522, 15531, 15532, 15736, 15749, 15797, 15844,
+  15867, 15886, 15887, 15890, 15892, 15893, 15895, 15897, 15905, 15909,
+  15921, 15939.
 
 * CVE-2013-4237 The readdir_r function could write more than NAME_MAX bytes
   to the d_name member of struct dirent, or omit the terminating NUL

Modified: fsf/trunk/libc/csu/init-first.c
==============================================================================
--- fsf/trunk/libc/csu/init-first.c (original)
+++ fsf/trunk/libc/csu/init-first.c Tue Sep 10 00:02:32 2013
@@ -61,11 +61,8 @@
   if (!__libc_multiple_libcs)
     {
       /* Set the FPU control word to the proper default value if the
-	 kernel would use a different value.  (In a static program we
-	 don't have this information.)  */
-#ifdef SHARED
+	 kernel would use a different value.  */
       if (__fpu_control != GLRO(dl_fpu_control))
-#endif
 	__setfpucw (__fpu_control);
     }
 

Modified: fsf/trunk/libc/elf/dl-support.c
==============================================================================
--- fsf/trunk/libc/elf/dl-support.c (original)
+++ fsf/trunk/libc/elf/dl-support.c Tue Sep 10 00:02:32 2013
@@ -167,6 +167,9 @@
 uint64_t _dl_hwcap __attribute__ ((nocommon));
 uint64_t _dl_hwcap2 __attribute__ ((nocommon));
 
+/* The value of the FPU control word the kernel will preset in hardware.  */
+fpu_control_t _dl_fpu_control = _FPU_DEFAULT;
+
 /* This is not initialized to HWCAP_IMPORTANT, matching the definition
    of _dl_important_hwcaps, below, where no hwcap strings are ever
    used.  This mask is still used to mediate the lookups in the cache
@@ -252,6 +255,9 @@
 	break;
       case AT_HWCAP2:
 	GLRO(dl_hwcap2) = (unsigned long int) av->a_un.a_val;
+	break;
+      case AT_FPUCW:
+	GLRO(dl_fpu_control) = av->a_un.a_val;
 	break;
 #ifdef NEED_DL_SYSINFO
       case AT_SYSINFO:

Modified: fsf/trunk/libc/libio/memstream.c
==============================================================================
--- fsf/trunk/libc/libio/memstream.c (original)
+++ fsf/trunk/libc/libio/memstream.c Tue Sep 10 00:02:32 2013
@@ -84,7 +84,10 @@
 
   buf = calloc (1, _IO_BUFSIZ);
   if (buf == NULL)
-    return NULL;
+    {
+      free (new_f);
+      return NULL;
+    }
   _IO_init (&new_f->fp._sf._sbf._f, 0);
   _IO_JUMPS ((struct _IO_FILE_plus *) &new_f->fp._sf._sbf) = &_IO_mem_jumps;
   _IO_str_init_static_internal (&new_f->fp._sf, buf, _IO_BUFSIZ, buf);

Modified: fsf/trunk/libc/libio/wmemstream.c
==============================================================================
--- fsf/trunk/libc/libio/wmemstream.c (original)
+++ fsf/trunk/libc/libio/wmemstream.c Tue Sep 10 00:02:32 2013
@@ -85,8 +85,10 @@
 
   buf = calloc (1, _IO_BUFSIZ);
   if (buf == NULL)
-    return NULL;
-
+    {
+      free (new_f);
+      return NULL;
+    }
   _IO_no_init (&new_f->fp._sf._sbf._f, 0, 0, &new_f->wd, &_IO_wmem_jumps);
   _IO_fwide (&new_f->fp._sf._sbf._f, 1);
   _IO_wstr_init_static (&new_f->fp._sf._sbf._f, buf,

Modified: fsf/trunk/libc/malloc/Makefile
==============================================================================
--- fsf/trunk/libc/malloc/Makefile (original)
+++ fsf/trunk/libc/malloc/Makefile Tue Sep 10 00:02:32 2013
@@ -25,7 +25,8 @@
 dist-headers := malloc.h
 headers := $(dist-headers) obstack.h mcheck.h
 tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \
-	 tst-mallocstate tst-mcheck tst-mallocfork tst-trim1 tst-malloc-usable
+	 tst-mallocstate tst-mcheck tst-mallocfork tst-trim1 \
+	 tst-malloc-usable tst-realloc
 test-srcs = tst-mtrace
 
 routines = malloc morecore mcheck mtrace obstack

Added: fsf/trunk/libc/malloc/tst-realloc.c
==============================================================================
--- fsf/trunk/libc/malloc/tst-realloc.c (added)
+++ fsf/trunk/libc/malloc/tst-realloc.c Tue Sep 10 00:02:32 2013
@@ -1,0 +1,146 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <malloc.h>
+#include <stdio.h>
+#include <string.h>
+
+static int errors = 0;
+
+static void
+merror (const char *msg)
+{
+  ++errors;
+  printf ("Error: %s\n", msg);
+}
+
+static int
+do_test (void)
+{
+  void *p;
+  unsigned char *c;
+  int save, i, ok;
+
+  errno = 0;
+
+  /* realloc (NULL, ...) behaves similarly to malloc (C89).  */
+  p = realloc (NULL, -1);
+  save = errno;
+
+  if (p != NULL)
+    merror ("realloc (NULL, -1) succeeded.");
+
+  /* errno should be set to ENOMEM on failure (POSIX).  */
+  if (p == NULL && save != ENOMEM)
+    merror ("errno is not set correctly");
+
+  errno = 0;
+
+  /* realloc (NULL, ...) behaves similarly to malloc (C89).  */
+  p = realloc (NULL, 10);
+  save = errno;
+
+  if (p == NULL)
+    merror ("realloc (NULL, 10) failed.");
+
+  /* errno should be clear on success (POSIX).  */
+  if (p != NULL && save != 0)
+    merror ("errno is set but should not be");
+
+  free (p);
+
+  p = calloc (20, 1);
+  if (p == NULL)
+    merror ("calloc (20, 1) failed.");
+
+  /* Check increasing size preserves contents (C89).  */
+  p = realloc (p, 200);
+  if (p == NULL)
+    merror ("realloc (p, 200) failed.");
+
+  c = p;
+  ok = 1;
+
+  for (i = 0; i < 20; i++)
+    {
+      if (c[i] != 0)
+	ok = 0;
+    }
+
+  if (ok == 0)
+	merror ("first 20 bytes were not cleared");
+
+  free (p);
+
+  p = realloc (NULL, 100);
+  if (p == NULL)
+    merror ("realloc (NULL, 100) failed.");
+
+  memset (p, 0xff, 100);
+
+  /* Check decreasing size preserves contents (C89).  */
+  p = realloc (p, 16);
+  if (p == NULL)
+    merror ("realloc (p, 16) failed.");
+
+  c = p;
+  ok = 1;
+
+  for (i = 0; i < 16; i++)
+    {
+      if (c[i] != 0xff)
+	ok = 0;
+    }
+
+  if (ok == 0)
+	merror ("first 16 bytes were not correct");
+
+  /* Check failed realloc leaves original untouched (C89).  */
+  c = realloc (p, -1);
+  if (c != NULL)
+    merror ("realloc (p, -1) succeeded.");
+
+  c = p;
+  ok = 1;
+
+  for (i = 0; i < 16; i++)
+    {
+      if (c[i] != 0xff)
+	ok = 0;
+    }
+
+  if (ok == 0)
+	merror ("first 16 bytes were not correct after failed realloc");
+
+  /* realloc (p, 0) frees p (C89) and returns NULL (glibc).  */
+  p = realloc (p, 0);
+  if (p != NULL)
+    merror ("realloc (p, 0) returned non-NULL.");
+
+  /* realloc (NULL, 0) acts like malloc (0) (glibc).  */
+  p = realloc (NULL, 0);
+  if (p == NULL)
+    merror ("realloc (NULL, 0) returned NULL.");
+
+  free (p);
+
+  return errors != 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/manual/string.texi
==============================================================================
--- fsf/trunk/libc/manual/string.texi (original)
+++ fsf/trunk/libc/manual/string.texi Tue Sep 10 00:02:32 2013
@@ -1370,7 +1370,7 @@
 compare_elements (const void *v1, const void *v2)
 @{
   char * const *p1 = v1;
-  char * const *p1 = v2;
+  char * const *p2 = v2;
 
   return strcoll (*p1, *p2);
 @}

Modified: fsf/trunk/libc/math/Makefile
==============================================================================
--- fsf/trunk/libc/math/Makefile (original)
+++ fsf/trunk/libc/math/Makefile Tue Sep 10 00:02:32 2013
@@ -87,9 +87,11 @@
 
 # Rules for the test suite.
 tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
-	test-misc test-fpucw tst-definitions test-tgmath test-tgmath-ret \
-	bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int \
-	test-tgmath2 test-powl tst-CMPLX tst-CMPLX2 test-snan
+	test-misc test-fpucw test-fpucw-ieee tst-definitions test-tgmath \
+	test-tgmath-ret bug-nextafter bug-nexttoward bug-tgmath1 \
+	test-tgmath-int test-tgmath2 test-powl tst-CMPLX tst-CMPLX2 test-snan \
+	$(tests-static)
+tests-static = test-fpucw-static test-fpucw-ieee-static
 # We do the `long double' tests only if this data type is available and
 # distinct from `double'.
 test-longdouble-yes = test-ldouble test-ildoubl
@@ -217,7 +219,8 @@
 	$(LN_S) $(<F) $(@F)
 
 ifeq ($(build-shared),yes)
-$(addprefix $(objpfx),$(tests)): $(objpfx)libm.so$(libm.so-version)
+$(addprefix $(objpfx),$(filter-out $(tests-static),$(tests))): $(objpfx)libm.so$(libm.so-version)
+$(addprefix $(objpfx),$(tests-static)): $(objpfx)libm.a
 else
 $(addprefix $(objpfx),$(tests)): $(objpfx)libm.a
 endif

Added: fsf/trunk/libc/math/test-fpucw-ieee-static.c
==============================================================================
--- fsf/trunk/libc/math/test-fpucw-ieee-static.c (added)
+++ fsf/trunk/libc/math/test-fpucw-ieee-static.c Tue Sep 10 00:02:32 2013
@@ -1,0 +1,1 @@
+#include "test-fpucw-ieee.c"

Added: fsf/trunk/libc/math/test-fpucw-ieee.c
==============================================================================
--- fsf/trunk/libc/math/test-fpucw-ieee.c (added)
+++ fsf/trunk/libc/math/test-fpucw-ieee.c Tue Sep 10 00:02:32 2013
@@ -1,0 +1,24 @@
+/* FPU control word overridden initialization test.
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define FPU_CONTROL _FPU_IEEE
+
+#include "test-fpucw.c"
+
+/* Preempt the library's definition of `__fpu_control'.  */
+fpu_control_t __fpu_control = _FPU_IEEE;

Added: fsf/trunk/libc/math/test-fpucw-static.c
==============================================================================
--- fsf/trunk/libc/math/test-fpucw-static.c (added)
+++ fsf/trunk/libc/math/test-fpucw-static.c Tue Sep 10 00:02:32 2013
@@ -1,0 +1,1 @@
+#include "test-fpucw.c"

Modified: fsf/trunk/libc/math/test-fpucw.c
==============================================================================
--- fsf/trunk/libc/math/test-fpucw.c (original)
+++ fsf/trunk/libc/math/test-fpucw.c Tue Sep 10 00:02:32 2013
@@ -19,6 +19,10 @@
 #include <fpu_control.h>
 #include <stdio.h>
 
+#ifndef FPU_CONTROL
+# define FPU_CONTROL _FPU_DEFAULT
+#endif
+
 int
 main (void)
 {
@@ -30,11 +34,11 @@
 
   cw &= ~_FPU_RESERVED;
 
-  if (cw != (_FPU_DEFAULT & ~_FPU_RESERVED))
+  if (cw != (FPU_CONTROL & ~_FPU_RESERVED))
     printf ("control word is 0x%lx but should be 0x%lx.\n",
-	    (long int) cw, (long int) (_FPU_DEFAULT & ~_FPU_RESERVED));
+	    (long int) cw, (long int) (FPU_CONTROL & ~_FPU_RESERVED));
 
-  return cw != (_FPU_DEFAULT & ~_FPU_RESERVED);
+  return cw != (FPU_CONTROL & ~_FPU_RESERVED);
 
 #else
   return 0;

Modified: fsf/trunk/libc/nscd/netgroupcache.c
==============================================================================
--- fsf/trunk/libc/nscd/netgroupcache.c (original)
+++ fsf/trunk/libc/nscd/netgroupcache.c Tue Sep 10 00:02:32 2013
@@ -591,10 +591,10 @@
 # endif
 	}
       else
-	{
-# ifndef __ASSUME_SENDFILE
+#endif
+	{
+#if defined HAVE_SENDFILE && !defined __ASSUME_SENDFILE
 	use_write:
-# endif
 #endif
 	  writeall (fd, &dataset->resp, sizeof (innetgroup_response_header));
 	}

Modified: fsf/trunk/libc/stdlib/isomac.c
==============================================================================
--- fsf/trunk/libc/stdlib/isomac.c (original)
+++ fsf/trunk/libc/stdlib/isomac.c Tue Sep 10 00:02:32 2013
@@ -263,6 +263,7 @@
   if (system (command))
     {
       puts ("system() returned nonzero");
+      free (command);
       return NULL;
     }
   free (command);

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits