diff options
author | Gerrit Pape <pape@smarden.org> | 2003-06-17 13:48:35 +0000 |
---|---|---|
committer | Gerrit Pape <pape@smarden.org> | 2003-06-17 13:48:35 +0000 |
commit | 2208761ba51953b772d78bb99229abeb5cf2231b (patch) | |
tree | 9787eebc26da26fbe0da5bde0a0b657cc12429b4 /src | |
parent | ea4074e15836b82ae6e12f0d2c636ab5642f01f0 (diff) | |
download | runit-2208761ba51953b772d78bb99229abeb5cf2231b.tar.gz runit-2208761ba51953b772d78bb99229abeb5cf2231b.tar.xz runit-2208761ba51953b772d78bb99229abeb5cf2231b.zip |
* runit.c: user select() on systems that don't provide poll() (builds
on Mac OSX). * svlogd.c: reset match flag in lineflush() in all cases. * Makefile: build setuidgid in default target. * doc/useinit.html: add instruction to create /etc/runit/2 first. * doc/install.html: minor. 0.9.5.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 2 | ||||
-rw-r--r-- | src/runit.c | 14 | ||||
-rw-r--r-- | src/svlogd.c | 1 |
3 files changed, 13 insertions, 4 deletions
diff --git a/src/Makefile b/src/Makefile index a027310..3a3788a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ IT=sysdeps runit runit-init runsv runsvctrl runsvstat runsvdir runsvchdir \ -svwaitup svwaitdown utmpset svlogd +svwaitup svwaitdown utmpset svlogd setuidgid default: $(IT) diff --git a/src/runit.c b/src/runit.c index 5637d75..225333a 100644 --- a/src/runit.c +++ b/src/runit.c @@ -1,5 +1,3 @@ -#include <poll.h> - #include <sys/types.h> #include <sys/reboot.h> #include <sys/ioctl.h> @@ -48,6 +46,9 @@ int main (int argc, const char * const *argv, char * const *envp) { int wstat; int st; iopause_fd x; +#ifndef IOPAUSE_POLL + fd_set rfds; +#endif char ch; int ttyfd; struct stat s; @@ -135,14 +136,21 @@ int main (int argc, const char * const *argv, char * const *envp) { x.fd =selfpipe[0]; x.events =IOPAUSE_READ; - +#ifndef IOPAUSE_POLL + FD_ZERO(&rfds); + FD_SET(x.fd, &rfds); +#endif for (;;) { int child; sig_unblock(sig_child); sig_unblock(sig_cont); sig_unblock(sig_int); +#ifdef IOPAUSE_POLL poll(&x, 1, -1); +#else + select(x.fd +1, &rfds, (fd_set*)0, (fd_set*)0, (struct timeval*)0); +#endif sig_block(sig_cont); sig_block(sig_child); sig_block(sig_int); diff --git a/src/svlogd.c b/src/svlogd.c index 37015ba..d77a938 100644 --- a/src/svlogd.c +++ b/src/svlogd.c @@ -456,6 +456,7 @@ unsigned int lineadd(struct logdir *ld, char *s, int len) { unsigned int lineflush(struct logdir *ld, char *s, int len) { switch(ld->match) { case '-': + ld->match =0; return(0); case 0: linestart(ld, s, len); |