mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
* malloc/malloc.c (malloc_printerr): Use syslog if writev failed.
This commit is contained in:
@ -1,5 +1,7 @@
|
|||||||
2004-09-22 Ulrich Drepper <drepper@redhat.com>
|
2004-09-22 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* malloc/malloc.c (malloc_printerr): Use syslog if writev failed.
|
||||||
|
|
||||||
* string/string.h: Add __nonnull annotations.
|
* string/string.h: Add __nonnull annotations.
|
||||||
* stdlib/stdlib.h: Likewise.
|
* stdlib/stdlib.h: Likewise.
|
||||||
|
|
||||||
|
@ -285,6 +285,8 @@ extern "C" {
|
|||||||
|
|
||||||
/* For writev and struct iovec. */
|
/* For writev and struct iovec. */
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
/* For syslog. */
|
||||||
|
#include <sys/syslog.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Debugging:
|
Debugging:
|
||||||
@ -5467,7 +5469,12 @@ malloc_printerr(int action, const char *str, void *ptr)
|
|||||||
iov[n].iov_base = cp;
|
iov[n].iov_base = cp;
|
||||||
iov[n].iov_len = &buf[sizeof (buf) - 1] - cp;
|
iov[n].iov_len = &buf[sizeof (buf) - 1] - cp;
|
||||||
++n;
|
++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)
|
if (action & 2)
|
||||||
abort ();
|
abort ();
|
||||||
|
Reference in New Issue
Block a user