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

[Commits] r16712 - in /fsf/trunk/libc: ChangeLog malloc/hooks.c malloc/malloc.c stdlib/Makefile stdlib/bug-fmtmsg1.c stdlib/fmtmsg.c



Author: eglibc
Date: Tue Jan 17 00:02:09 2012
New Revision: 16712

Log:
Import glibc-mainline for 2012-01-17

Added:
    fsf/trunk/libc/stdlib/bug-fmtmsg1.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/malloc/hooks.c
    fsf/trunk/libc/malloc/malloc.c
    fsf/trunk/libc/stdlib/Makefile
    fsf/trunk/libc/stdlib/fmtmsg.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue Jan 17 00:02:09 2012
@@ -1,3 +1,14 @@
+2012-01-16  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* malloc/malloc.c: Various cleanups.
+	* malloc/hooks.c: Likewise.
+
+	* stdlib/Makefile (tests): Add bug-fmtmsg1.
+	* stdlib/bug-fmtmsg1.c: New file.
+
+	* stdlib/fmtmsg.c (init): Add missing unlock.
+	Patch by Peng Haitao <penght@xxxxxxxxxxxxxx>.
+
 2012-01-12  Marek Polacek  <polacek@xxxxxxxxxx>
 
 	* libio/bits/stdio2.h: Do not define gets for ISO C11, ISO C++11,

Modified: fsf/trunk/libc/malloc/hooks.c
==============================================================================
--- fsf/trunk/libc/malloc/hooks.c (original)
+++ fsf/trunk/libc/malloc/hooks.c Tue Jan 17 00:02:09 2012
@@ -1,5 +1,5 @@
 /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 2001-2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2001-2009, 2011, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wg@xxxxxxxxx>, 2001.
 
@@ -98,7 +98,7 @@
 mem2mem_check(void *ptr, size_t sz)
 {
   mchunkptr p;
-  unsigned char* m_ptr = (unsigned char*)BOUNDED_N(ptr, sz);
+  unsigned char* m_ptr = ptr;
   size_t i;
 
   if (!ptr)
@@ -302,7 +302,7 @@
 	if (top_check() >= 0)
 	  newmem = _int_malloc(&main_arena, bytes+1);
 	if (newmem) {
-	  MALLOC_COPY(BOUNDED_N(newmem, bytes+1), oldmem, oldsize - 2*SIZE_SZ);
+	  MALLOC_COPY(newmem, oldmem, oldsize - 2*SIZE_SZ);
 	  munmap_chunk(oldp);
 	}
       }

Modified: fsf/trunk/libc/malloc/malloc.c
==============================================================================
--- fsf/trunk/libc/malloc/malloc.c (original)
+++ fsf/trunk/libc/malloc/malloc.c Tue Jan 17 00:02:09 2012
@@ -179,7 +179,6 @@
 
     Configuration and functionality options:
 
-    USE_DL_PREFIX              NOT defined
     USE_PUBLIC_MALLOC_WRAPPERS NOT defined
     USE_MALLOC_LOCK            NOT defined
     MALLOC_DEBUG               NOT defined
@@ -226,10 +225,6 @@
 
 #include <ldsodefs.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include <unistd.h>
 #include <stdio.h>    /* needed for malloc_stats */
 #include <errno.h>
@@ -239,14 +234,6 @@
 
 /* For va_arg, va_start, va_end.  */
 #include <stdarg.h>
-
-/* For writev and struct iovec.  */
-#include <sys/uio.h>
-/* For syslog.  */
-#include <sys/syslog.h>
-
-/* For various dynamic linking things.  */
-#include <dlfcn.h>
 
 
 /*
@@ -401,40 +388,10 @@
 
 
 /*
-  USE_DL_PREFIX will prefix all public routines with the string 'dl'.
-  This is necessary when you only want to use this malloc in one part
-  of a program, using your regular system malloc elsewhere.
-*/
-
-/* #define USE_DL_PREFIX */
-
-
-/*
    Two-phase name translation.
    All of the actual routines are given mangled names.
    When wrappers are used, they become the public callable versions.
-   When DL_PREFIX is used, the callable names are prefixed.
-*/
-
-#ifdef USE_DL_PREFIX
-#define public_cALLOc    dlcalloc
-#define public_fREe      dlfree
-#define public_cFREe     dlcfree
-#define public_mALLOc    dlmalloc
-#define public_mEMALIGn  dlmemalign
-#define public_rEALLOc   dlrealloc
-#define public_vALLOc    dlvalloc
-#define public_pVALLOc   dlpvalloc
-#define public_mALLINFo  dlmallinfo
-#define public_mALLOPt   dlmallopt
-#define public_mTRIm     dlmalloc_trim
-#define public_mSTATs    dlmalloc_stats
-#define public_mUSABLe   dlmalloc_usable_size
-#define public_iCALLOc   dlindependent_calloc
-#define public_iCOMALLOc dlindependent_comalloc
-#define public_gET_STATe dlget_state
-#define public_sET_STATe dlset_state
-#else /* USE_DL_PREFIX */
+*/
 
 /* Special defines for the GNU C library.  */
 #define public_cALLOc    __libc_calloc
@@ -465,8 +422,6 @@
 void * __default_morecore (ptrdiff_t);
 void *(*__morecore)(ptrdiff_t) = __default_morecore;
 
-#endif /* USE_DL_PREFIX */
-
 
 #include <string.h>
 
@@ -1112,15 +1067,8 @@
 #define DEFAULT_MMAP_MAX       (65536)
 #endif
 
-#ifdef __cplusplus
-} /* end of extern "C" */
-#endif
-
 #include <malloc.h>
 
-#ifndef BOUNDED_N
-#define BOUNDED_N(ptr, sz) (ptr)
-#endif
 #ifndef RETURN_ADDRESS
 #define RETURN_ADDRESS(X_) (NULL)
 #endif

Modified: fsf/trunk/libc/stdlib/Makefile
==============================================================================
--- fsf/trunk/libc/stdlib/Makefile (original)
+++ fsf/trunk/libc/stdlib/Makefile Tue Jan 17 00:02:09 2012
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2009, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1991-2009, 2011, 2012 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
@@ -71,7 +71,7 @@
 		   tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2 \
 		   tst-makecontext tst-strtod4 tst-strtod5 tst-qsort2	    \
 		   tst-makecontext2 tst-strtod6 tst-unsetenv1		    \
-		   tst-makecontext3 bug-getcontext
+		   tst-makecontext3 bug-getcontext bug-fmtmsg1
 
 include ../Makeconfig
 
@@ -121,6 +121,7 @@
 tst-strtod4-ENV = LOCPATH=$(common-objpfx)localedata
 tst-strtod5-ENV = LOCPATH=$(common-objpfx)localedata
 testmb2-ENV = LOCPATH=$(common-objpfx)localedata
+bug-fmtmsg1-ENV = SEV_LEVEL=foo,11,newsev
 
 # Run a test on the header files we use.
 tests: $(objpfx)isomac.out

Added: fsf/trunk/libc/stdlib/bug-fmtmsg1.c
==============================================================================
--- fsf/trunk/libc/stdlib/bug-fmtmsg1.c (added)
+++ fsf/trunk/libc/stdlib/bug-fmtmsg1.c Tue Jan 17 00:02:09 2012
@@ -1,0 +1,28 @@
+#include <fmtmsg.h>
+#include <stdio.h>
+
+
+static int
+do_test (void)
+{
+  /* Ugly, but fmtmsg would otherwise print to stderr which we do not
+     want.  */
+  fclose (stderr);
+  stderr = stdout;
+
+  int e1;
+  e1 = fmtmsg (MM_PRINT, "label:part", MM_WARNING, "text", "action", "tag");
+
+  int e2;
+  e2 = fmtmsg (MM_PRINT, "label2:part2", 11, "text2", "action2", "tag2");
+
+  addseverity (10, "additional severity");
+
+  int e3;
+  e3 = fmtmsg (MM_PRINT, "label3:part3", 10, "text3", "action3", "tag3");
+
+  return e1 != 0 || e2 != 0 || e3 != 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/stdlib/fmtmsg.c
==============================================================================
--- fsf/trunk/libc/stdlib/fmtmsg.c (original)
+++ fsf/trunk/libc/stdlib/fmtmsg.c Tue Jan 17 00:02:09 2012
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997,1999-2003,2005,2006,2011 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1999-2003,2005,2006,2011,2012
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -280,6 +281,8 @@
 
 	  sevlevel_var = end + (*end == ':' ? 1 : 0);
 	}
+
+      __libc_lock_unlock (lock);
     }
 }
 

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