summaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-09-25 07:55:46 +0000
committerJakub Jelinek <jakub@redhat.com>2004-09-25 07:55:46 +0000
commitbd7c3bed543d02fb01f69b29ea1a736e7a0f618d (patch)
tree7e9bf02d1315ce177dd95075686ba769057d04b2 /malloc
parent338cc5101b59b64358bab982e1311604fdb64651 (diff)
Updated to fedora-glibc-20040925T0738
Diffstat (limited to 'malloc')
-rw-r--r--malloc/malloc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 665d7a4b3e..dcc54c46f1 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -285,6 +285,8 @@ extern "C" {
/* For writev and struct iovec. */
#include <sys/uio.h>
+ /* For syslog. */
+#include <sys/syslog.h>
/*
Debugging:
@@ -5467,7 +5469,12 @@ malloc_printerr(int action, const char *str, void *ptr)
iov[n].iov_base = cp;
iov[n].iov_len = &buf[sizeof (buf) - 1] - cp;
++n;
- TEMP_FAILURE_RETRY (__writev (STDERR_FILENO, iov, n));
+ if (TEMP_FAILURE_RETRY (__writev (STDERR_FILENO, iov, n)) == -1
+ && errno == EBADF)
+ /* Standard error is not opened. Try using syslog. */
+ syslog (LOG_ERR, "%s%s%s", (char *) iov[0].iov_base,
+ (char *) iov[1].iov_base,
+ n == 3 ? (const char *) iov[2].iov_base : "");
}
if (action & 2)
abort ();