runit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit ea2a0cb98d12bfe3ef151fd4ed2c221a52866dca
parent 2a6441584e03d1f7c3c53be59d4b4a75ce763624
Author: Gerrit Pape <pape@smarden.org>
Date:   Mon, 19 Jan 2004 12:20:03 +0000

  * 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:
Mpackage/CHANGES | 5+++++
Msrc/Makefile | 18++++++++++++++----
Msrc/TARGETS | 3+++
Msrc/svlogd.c | 13++++++++++---
Asrc/trysocketlib.c | 12++++++++++++
5 files changed, 44 insertions(+), 7 deletions(-)

diff --git a/package/CHANGES b/package/CHANGES @@ -1,4 +1,9 @@ * doc/upgrade.html: typo. + * 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. runit 0.13.0 Mon, 12 Jan 2004 14:39:38 +0000 diff --git a/src/Makefile b/src/Makefile @@ -33,8 +33,9 @@ utmpset: load utmpset.o unix.a byte.a runsvchdir: load runsvchdir.o unix.a byte.a ./load runsvchdir unix.a byte.a -svlogd: load svlogd.o pmatch.o fmt_ptime.o unix.a byte.a time.a - ./load svlogd pmatch.o fmt_ptime.o unix.a byte.a time.a +svlogd: load svlogd.o pmatch.o fmt_ptime.o unix.a byte.a time.a socket.lib + ./load svlogd pmatch.o fmt_ptime.o unix.a byte.a time.a \ + `cat socket.lib` chpst: load chpst.o uidgid.o unix.a byte.a ./load chpst uidgid.o unix.a byte.a @@ -94,6 +95,15 @@ uw_tmp.h: compile uw_tmp.h1 uw_tmp.h2 ( ./compile tryuwtmp.c 2>/dev/null && cat uw_tmp.h1 >uw_tmp.h ) rm -f tryuwtmp.o tryuwtmpx.o +socket.lib: compile load trysocketlib.c + ./compile trysocketlib.c + ( ./load trysocketlib >/dev/null 2>&1 || \ + ( ./load trysocketlib -lxnet >/dev/null 2>&1 && echo '-lxnet' ) || \ + ( ./load trysocketlib -lsocket -lnsl >/dev/null 2>&1 && \ + echo '-lsocket -lnsl' ) \ + ) >socket.lib + rm -f trysocketlib.o trysocketlib + clean: find . -name \*~ -exec rm -f {} \; find . -name .??*~ -exec rm -f {} \; @@ -355,9 +365,9 @@ subgetopt.o: compile subgetopt.c subgetopt.h sysdeps: compile direntry.h hasflock.h hasmkffo.h hassgact.h \ hassgprm.h hasshsgr.h haswaitp.h iopause.h load select.h systype \ -uint64.h reboot_system.h uw_tmp.h +uint64.h reboot_system.h uw_tmp.h socket.lib rm -f sysdeps - cat systype compile load >>sysdeps + cat systype compile load socket.lib >>sysdeps grep sysdep direntry.h >>sysdeps grep sysdep haswaitp.h >>sysdeps grep sysdep hassgact.h >>sysdeps diff --git a/src/TARGETS b/src/TARGETS @@ -27,6 +27,9 @@ fmt_ptime.o uidgid.o reboot_system.h uw_tmp.h +socket.lib +trysocketlib +trysocketlib.o alloc.o alloc_re.o buffer.o diff --git 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); diff --git a/src/trysocketlib.c b/src/trysocketlib.c @@ -0,0 +1,12 @@ +#include <sys/types.h> +#include <sys/param.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <unistd.h> + +int main(void) { + int s; + + s =socket(AF_INET, SOCK_STREAM, 0); + return(close(s)); +}