about summary refs log tree commit diff
path: root/malloc/malloc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-09-09 21:10:29 +0000
committerUlrich Drepper <drepper@redhat.com>2004-09-09 21:10:29 +0000
commita962d7dc18f73d075ef0bc4b6e08b05920b49353 (patch)
tree312bace5c418d3147bb1554642ecbda101f49356 /malloc/malloc.c
parent14abadc8bf54ed8cf3585aa2f0aa869df4f83983 (diff)
downloadglibc-a962d7dc18f73d075ef0bc4b6e08b05920b49353.tar.gz
glibc-a962d7dc18f73d075ef0bc4b6e08b05920b49353.tar.xz
glibc-a962d7dc18f73d075ef0bc4b6e08b05920b49353.zip
Update.
2004-09-09  Ulrich Drepper  <drepper@redhat.com>

	* malloc/hooks.c (top_check): Print top chunk corruption as normal
	error message.

	* malloc/malloc.c (malloc_printerr): Don't make informational
	message look like error message.
Diffstat (limited to 'malloc/malloc.c')
-rw-r--r--malloc/malloc.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 824b6cc3f4..0d0990cc35 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -5453,13 +5453,20 @@ malloc_printerr(int action, const char *str, void *ptr)
 	}
 
       struct iovec iov[3];
-      iov[0].iov_base = (char *) "*** glibc detected *** ";
-      iov[0].iov_len = strlen (iov[0].iov_base);
-      iov[1].iov_base = (char *) str;
-      iov[1].iov_len = strlen (str);
-      iov[2].iov_base = cp;
-      iov[2].iov_len = &buf[sizeof (buf) - 1] - cp;
-      TEMP_FAILURE_RETRY (__writev (STDERR_FILENO, iov, 3));
+      int n = 0;
+      if ((action & 4) == 0)
+	{
+	  iov[0].iov_base = (char *) "*** glibc detected *** ";
+	  iov[0].iov_len = strlen (iov[0].iov_base);
+	  ++n;
+	}
+      iov[n].iov_base = (char *) str;
+      iov[n].iov_len = strlen (str);
+      ++n;
+      iov[n].iov_base = cp;
+      iov[n].iov_len = &buf[sizeof (buf) - 1] - cp;
+      ++n;
+      TEMP_FAILURE_RETRY (__writev (STDERR_FILENO, iov, n));
     }
   if (action & 2)
     abort ();