diff options
author | Ulrich Drepper <drepper@redhat.com> | 2002-12-13 19:43:31 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2002-12-13 19:43:31 +0000 |
commit | d94e16c4feff9e16391fe34f11f8e7e0de02f891 (patch) | |
tree | da9201e28fb26073df5b13356b0a0893b7355479 | |
parent | 9ae0909b35bc7ed04897536cbf224f7e134b5184 (diff) | |
download | glibc-d94e16c4feff9e16391fe34f11f8e7e0de02f891.tar.gz glibc-d94e16c4feff9e16391fe34f11f8e7e0de02f891.tar.xz glibc-d94e16c4feff9e16391fe34f11f8e7e0de02f891.zip |
Update.
* elf/dl-misc.c (_dl_debug_vdprintf): Don't depend on 5-digit PIDs.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | elf/dl-misc.c | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog index 7062cdbb12..94cde7eda7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2002-12-13 Ulrich Drepper <drepper@redhat.com> + * elf/dl-misc.c (_dl_debug_vdprintf): Don't depend on 5-digit PIDs. + * misc/syslog.c (log_cleanup): Don't use parameter in __libc_lock_unlock call, use syslog_lock directly. Adjust callers to pass NULL instead of a pointer to syslog_lock. diff --git a/elf/dl-misc.c b/elf/dl-misc.c index 979de9b7ac..2b461736e9 100644 --- a/elf/dl-misc.c +++ b/elf/dl-misc.c @@ -92,7 +92,7 @@ _dl_debug_vdprintf (int fd, int tag_p, const char *fmt, va_list arg) struct iovec iov[niovmax]; int niov = 0; pid_t pid = 0; - char pidbuf[7]; + char pidbuf[12]; while (*fmt != '\0') { @@ -106,17 +106,17 @@ _dl_debug_vdprintf (int fd, int tag_p, const char *fmt, va_list arg) { char *p; pid = __getpid (); - assert (pid >= 0 && pid < 100000); - p = _itoa (pid, &pidbuf[5], 10, 0); + assert (pid >= 0 && sizeof (pid_t) <= 4); + p = _itoa (pid, &pidbuf[10], 10, 0); while (p > pidbuf) - *--p = '0'; - pidbuf[5] = ':'; - pidbuf[6] = '\t'; + *--p = ' '; + pidbuf[10] = ':'; + pidbuf[11] = '\t'; } /* Append to the output. */ assert (niov < niovmax); - iov[niov].iov_len = 7; + iov[niov].iov_len = 12; iov[niov++].iov_base = pidbuf; /* No more tags until we see the next newline. */ |