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.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/elf/dl-misc.c b/elf/dl-misc.c
index 937aeac0c9..8a441c0a3a 100644
--- a/elf/dl-misc.c
+++ b/elf/dl-misc.c
@@ -106,12 +106,9 @@ _dl_debug_message (int new_line, const char *msg, ...)
 {
   /* We print the strings we get passed one after the other but start all
      lines using the current PID.  */
-  static int pid;
+  int pid = 0;
   va_list ap;
 
-  if (pid == 0)
-    pid = __getpid ();
-
   va_start (ap, msg);
   do
     if (msg[0] == '\0')
@@ -127,6 +124,8 @@ _dl_debug_message (int new_line, const char *msg, ...)
 	  {
 	    char buf[7];
 	    char *p;
+	    if (pid == 0)
+	      pid = __getpid ();
 	    assert (pid >= 0 && pid < 100000);
 	    p = _itoa_word (pid, &buf[5], 10, 0);
 	    while (p > buf)