about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-01-07 21:49:38 +0000
committerUlrich Drepper <drepper@redhat.com>2005-01-07 21:49:38 +0000
commitae7f5313dfb6c9df557d3904a22ac74d3347eed1 (patch)
tree65e2947954e0d219b62085cfc61cdc5eaa498ecb
parent9ee4c01788073b3f061b84c0df966dd334cf0ca2 (diff)
downloadglibc-ae7f5313dfb6c9df557d3904a22ac74d3347eed1.tar.gz
glibc-ae7f5313dfb6c9df557d3904a22ac74d3347eed1.tar.xz
glibc-ae7f5313dfb6c9df557d3904a22ac74d3347eed1.zip
Update.
	* malloc/malloc.c (malloc_printerr): Print program name as part of
	error message.
-rw-r--r--ChangeLog3
-rw-r--r--malloc/malloc.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 402748a5d8..43331f98f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-01-07  Ulrich Drepper  <drepper@redhat.com>
 
+	* malloc/malloc.c (malloc_printerr): Print program name as part of
+	error message.
+
 	* misc/sys/cdefs.h (__attribute_warn_unused_result__): Define.
 	* stdlib/stdlib.h: Make realloc with
 	__attribute_warn_unused_result__ instead of __wur.
diff --git a/malloc/malloc.c b/malloc/malloc.c
index e3ccbde7b5..4d2169bf78 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1,5 +1,5 @@
   /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1996-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wg@malloc.de>
    and Doug Lea <dl@cs.oswego.edu>, 2001.
@@ -5508,6 +5508,8 @@ int mALLOPt(param_number, value) int param_number; int value;
 
 /* Helper code.  */
 
+extern char **__libc_argv attribute_hidden;
+
 static void
 malloc_printerr(int action, const char *str, void *ptr)
 {
@@ -5522,8 +5524,8 @@ malloc_printerr(int action, const char *str, void *ptr)
 
       __libc_message (action & 2,
 		      action & 4
-		      ? "%s\n" : "*** glibc detected *** %s: 0x%s ***\n",
-		      str, cp);
+		      ? "%s\n" : "*** glibc detected *** %s: %s: 0x%s ***\n",
+		      __libc_argv[0] ?: "<unknown>", str, cp);
     }
   else if (action & 2)
     abort ();