[patch] fix compilation breakage of syslogd and minor shrinkage

Denis Vlasenko vda.linux at googlemail.com
Tue Jan 9 15:44:36 PST 2007


On Tuesday 09 January 2007 12:21, Bernhard Fischer wrote:
> Hi,
> 
> Just enabling syslogd without any options gave compilation errors.
> 
> The attached series of patches fixes this error and shrinks syslogd a
> bit while at it (only some low-hanging fruit):
> 
>    text    data     bss     dec     hex filename
>    1857     304      72    2233     8b9 syslogd.o.01b
>    1857     304      72    2233     8b9 syslogd.o.01c
>    1810     304      72    2186     88a syslogd.o.01d
>    1808     304      72    2184     888 syslogd.o.01e
> 
> It is only compile tested so far.
> vda, please test and apply the hunks you like.

Thanks!


-/* FIXME: looks ip4-specific. need to do better */

Why did you remove this comment? It is still true...


  * that there is no timestamp, short-cutting the test. */
 static void timestamp_and_log(int pri, char *msg, int len)
 {
-       time_t now;
        char *timestamp;

        if (len < 16 || msg[3] != ' ' || msg[6] != ' '
         || msg[9] != ':' || msg[12] != ':' || msg[15] != ' '
        ) {
+               time_t now;
                time(&now);
                timestamp = ctime(&now) + 4;
        } else {

Moving variables like this changes nothing (last I checked, gcc
don't even share stack slots if you do { int i; ...} { int j; ....}


Applied most of your patches (dropped only a small part of last one).

Enjoy: http://busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/sysklogd/
--
vda


More information about the busybox mailing list