about summary refs log tree commit diff
path: root/elf/dl-misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-misc.c')
-rw-r--r--elf/dl-misc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/elf/dl-misc.c b/elf/dl-misc.c
index 1e13d0d28a..3d796360b3 100644
--- a/elf/dl-misc.c
+++ b/elf/dl-misc.c
@@ -77,7 +77,7 @@ _dl_sysdep_read_whole_file (const char *file, size_t *sizep, int prot)
 
 
 /* Descriptor to write debug messages to.  */
-int _dl_debug_fd;
+int _dl_debug_fd = 2;
 
 
 void
@@ -122,7 +122,9 @@ _dl_debug_message (int new_line, const char *msg, ...)
 	if (new_line)
 	  {
 	    char buf[7] = "00000:\t";
-	    __write (_dl_debug_fd, _itoa_word (pid, &buf[5], 10, 0), 7);
+	    assert (pid >= 0 && pid < 100000);
+	    _itoa_word (pid, &buf[5], 10, 0);
+	    __write (_dl_debug_fd, buf, 7);
 	    new_line = 0;
 	  }