From f123911c49df152e9b27ab4df77b12a03b6abfa2 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 3 Nov 2007 09:19:58 +0000 Subject: add rpid/rstatus --- ev.c | 12 +++++++++++- ev.h | 5 +++-- ev_select.c | 4 +++- evdns.c | 1 - 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ev.c b/ev.c index cca3a3d..7faa403 100644 --- a/ev.c +++ b/ev.c @@ -44,7 +44,9 @@ #include #include #include -#include +#ifndef WIN32 +# include +#endif #include #include @@ -440,12 +442,14 @@ sigcb (struct ev_io *iow, int revents) static void siginit (void) { +#ifndef WIN32 fcntl (sigpipe [0], F_SETFD, FD_CLOEXEC); fcntl (sigpipe [1], F_SETFD, FD_CLOEXEC); /* rather than sort out wether we really need nb, set it */ fcntl (sigpipe [0], F_SETFL, O_NONBLOCK); fcntl (sigpipe [1], F_SETFL, O_NONBLOCK); +#endif ev_io_set (&sigev, sigpipe [0], EV_READ); ev_io_start (&sigev); @@ -467,6 +471,8 @@ static int checkmax, checkcnt; static struct ev_child *childs [PID_HASHSIZE]; static struct ev_signal childev; +#ifndef WIN32 + #ifndef WCONTINUED # define WCONTINUED 0 #endif @@ -486,6 +492,8 @@ childcb (struct ev_signal *sw, int revents) } } +#endif + /*****************************************************************************/ #if EV_USE_KQUEUE @@ -566,8 +574,10 @@ int ev_init (int methods) ev_watcher_init (&sigev, sigcb); siginit (); +#ifndef WIN32 ev_signal_init (&childev, childcb, SIGCHLD); ev_signal_start (&childev); +#endif } } diff --git a/ev.h b/ev.h index 6e0e0bd..8d2922d 100644 --- a/ev.h +++ b/ev.h @@ -172,8 +172,9 @@ struct ev_child { EV_WATCHER_LIST (ev_child); - int pid; /* ro */ - int status; /* rw, holds the exit status, use the macros from sys/wait.h */ + int pid; /* ro */ + int rpid; /* rw, holds the received pid */ + int rstatus; /* rw, holds the exit status, use the macros from sys/wait.h */ }; #define EVMETHOD_AUTO 0 /* consults environment */ diff --git a/ev_select.c b/ev_select.c index 0333d63..a0db3b6 100644 --- a/ev_select.c +++ b/ev_select.c @@ -35,7 +35,9 @@ #include /* for unix systems */ -#include +#ifndef WIN32 +# include +#endif #include #include diff --git a/evdns.c b/evdns.c index fa81f38..78fbd3c 100644 --- a/evdns.c +++ b/evdns.c @@ -41,7 +41,6 @@ #endif #ifdef WIN32 -#include "misc.h" #endif /* #define NDEBUG */ -- cgit v1.2.3