BUG: logging to file on linux adds \0 to line-end.

Hello list,

During some tests i was doing i found that when logging to file (using
notifyme) resulted in lines starting with \0-char.
Further investigation showed that the bug is in ulog.c.
Following patch will correct the problem (for me). As i am not a programmer
i don't know if this breaks anything..... Be warned!

------ begin patch ------
--- ulog/ulog.c.orig    Thu Dec  7 18:48:55 2000
+++ ulog/ulog.c Thu Oct 25 11:17:36 2001
@@ -399,8 +399,11 @@
                tbuf[cnt] = 0;
        }
 #if __linux
-       /* Stream unix domain socket, wants the \0 as message terminator */
-       ++cnt;
+       if(logFilename == NULL) /* using syslogd */
+       {
+               /* Stream unix domain socket, wants the \0 as message 
terminator */
+               ++cnt;
+       }
 #endif
 #if TBUFDIAG
        fputs(tbuf, stdout);
------ end patch ------

Further info: using Debian Linux unstable on a PPro 200 with 256 MB RAM

Kind Regards,

Rob Epping.
-- 
Home is where a keyboard is.

  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the ldm-users archives: