]> mj.ucw.cz Git - libucw.git/commitdiff
Logging: Honor LSFMT_PID only when the PID is known.
authorMartin Mares <mj@ucw.cz>
Mon, 16 Feb 2009 22:55:23 +0000 (23:55 +0100)
committerMartin Mares <mj@ucw.cz>
Mon, 16 Feb 2009 22:55:23 +0000 (23:55 +0100)
ucw/log.c

index 2563c799aa0b09f995e54b42592ad08deef228a7..5c4a006982f863b760e9309d34deb51eaaa05e09 100644 (file)
--- a/ucw/log.c
+++ b/ucw/log.c
@@ -219,7 +219,7 @@ log_pass_msg(int depth, struct log_stream *ls, struct log_msg *m)
   /* Process name, PID ( |log_title| + 6 + (|PID|<=10) chars ) */
   if ((ls->msgfmt & LSFMT_TITLE) && log_title)
     {
-      if (ls->msgfmt & LSFMT_PID)
+      if ((ls->msgfmt & LSFMT_PID) && log_pid)
        p += sprintf(p, "[%s (%d)] ", log_title, log_pid);
       else
        p += sprintf(p, "[%s] ", log_title);