--- cvsroot/EV/EV.xs 2007/11/02 22:03:00 1.42 +++ cvsroot/EV/EV.xs 2007/11/03 10:37:28 1.46 @@ -27,6 +27,12 @@ *stash_check, *stash_child; +#ifndef SIG_SIZE +/* kudos to Slaven Rezic for the idea */ +static char sig_size [] = { SIG_NUM }; +# define SIG_SIZE (sizeof (sig_size) + 1) +#endif + static int sv_signum (SV *sig) { @@ -134,9 +140,6 @@ PUSHs (sv_self); PUSHs (sv_events); - if (revents & EV_CHILD) - XPUSHs (sv_status = newSViv (((struct ev_child *)w)->status)); - PUTBACK; call_sv (w->cb_sv, G_DISCARD | G_VOID | G_EVAL); SP = PL_stack_base + mark; PUTBACK; @@ -326,7 +329,7 @@ NV ev_time () -void ev_init (int methods = EVMETHOD_AUTO) +int ev_init (int methods = EVMETHOD_AUTO) void ev_loop (int flags = 0) @@ -418,7 +421,7 @@ ALIAS: check_ns = 1 CODE: - RETVAL = e_new (sizeof (struct ev_check), cb); + RETVAL = e_new (sizeof (struct ev_child), cb); ev_child_set (RETVAL, pid); if (!ix) ev_child_start (RETVAL); OUTPUT: @@ -715,9 +718,11 @@ RETVAL -int status (struct ev_child *w) +int rstatus (struct ev_child *w) + ALIAS: + rpid = 1 CODE: - RETVAL = w->status; + RETVAL = ix ? w->rpid : w->rstatus; OUTPUT: RETVAL