diff options
author | Gerrit Pape <pape@smarden.org> | 2004-01-19 12:20:03 +0000 |
---|---|---|
committer | Gerrit Pape <pape@smarden.org> | 2004-01-19 12:20:03 +0000 |
commit | 3863c7cf81744a96444c68e10b26dfc937389cbb (patch) | |
tree | 546b839595dfb4d825dfcde43d1fd6a58e1bbae1 /src/svlogd.c | |
parent | f6120c699dc78cda5ca61d50de997b5c17f4b731 (diff) | |
download | runit-3863c7cf81744a96444c68e10b26dfc937389cbb.tar.gz runit-3863c7cf81744a96444c68e10b26dfc937389cbb.tar.xz runit-3863c7cf81744a96444c68e10b26dfc937389cbb.zip |
* svlogd.c: bugfix: properly print new-line character to the log on end
of line (thx Pawel Chmielowski). * trysocketlib.c: new; check for libraries needed for socket() on some systems (fixes link failure on solaris, thx Uffe Jakobsen). * Makefile: adapt.
Diffstat (limited to 'src/svlogd.c')
-rw-r--r-- | src/svlogd.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/svlogd.c b/src/svlogd.c index 6ebbe9f..a0c2b7e 100644 --- a/src/svlogd.c +++ b/src/svlogd.c @@ -542,11 +542,18 @@ unsigned int lineflush(struct logdir *ld, char *s, int len) { linestart(ld, s, len); break; case '+': - ld->match =0; - if (ld->udponly) return(0); + if (ld->udponly) { + ld->match =0; + return(0); + } buffer_put(&ld->b, s, len); + ld->size +=len; + break; + } + if (ld->match == '+') { buffer_putflush(&ld->b, "\n", 1); - ld->size +=len +1; + ld->size +=1; + ld->match =0; if (ld->sizemax) if ((linelen > ld->sizemax) || (ld->size >= (ld->sizemax -linelen))) rotate(ld); |