This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix MALLOC_CHECK_={5,7}


Hi!

Since the Jan, 7th, malloc.c change malloc_printerr will print
just the program name instead of the error message, which isn't very
helpful.

2005-02-21  Jakub Jelinek  <jakub@redhat.com>

	* malloc/malloc.c (malloc_printerr): If MALLOC_CHECK_={5,7}, print
	the error message rather than program name.

--- libc/malloc/malloc.c.jj	2005-01-08 16:50:22.000000000 +0100
+++ libc/malloc/malloc.c	2005-02-21 10:58:05.269061553 +0100
@@ -5513,7 +5513,9 @@ extern char **__libc_argv attribute_hidd
 static void
 malloc_printerr(int action, const char *str, void *ptr)
 {
-  if (action & 1)
+  if ((action & 5) == 5)
+    __libc_message (action & 2, "%s\n", str);
+  else if (action & 1)
     {
       char buf[2 * sizeof (uintptr_t) + 1];
 
@@ -5523,8 +5525,7 @@ malloc_printerr(int action, const char *
 	*--cp = '0';
 
       __libc_message (action & 2,
-		      action & 4
-		      ? "%s\n" : "*** glibc detected *** %s: %s: 0x%s ***\n",
+		      "*** glibc detected *** %s: %s: 0x%s ***\n",
 		      __libc_argv[0] ?: "<unknown>", str, cp);
     }
   else if (action & 2)

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]