--- Async-Interrupt/schmorp.h 2009/07/17 21:04:45 1.4 +++ Async-Interrupt/schmorp.h 2009/08/05 11:51:53 1.7 @@ -22,6 +22,10 @@ && (PERL_VERSION > (b) \ || (PERL_VERSION == (b) && PERL_SUBVERSION >= (c))))) +#ifndef PERL_MAGIC_ext +# define PERL_MAGIC_ext '~' +#endif + #if !PERL_VERSION_ATLEAST (5,6,0) # ifndef PL_ppaddr # define PL_ppaddr ppaddr @@ -211,6 +215,8 @@ static int s_pipe (int filedes [2]) { + dTHX; + struct sockaddr_in addr = { 0 }; int addr_size = sizeof (addr); struct sockaddr_in adr2; @@ -361,6 +367,8 @@ if (s_fd_prepare (ep.fd [0]) || s_fd_prepare (ep.fd [1])) { + dTHX; + close (ep.fd [0]); close (ep.fd [1]); return -1; @@ -376,6 +384,8 @@ static void s_epipe_destroy (s_epipe *epp) { + dTHX; + close (epp->fd [0]); if (epp->fd [1] != epp->fd [0]) @@ -408,6 +418,7 @@ static void s_epipe_drain (s_epipe *epp) { + dTHX; char buf [9]; #ifdef _WIN32 @@ -421,6 +432,7 @@ static int s_epipe_renew (s_epipe *epp) { + dTHX; s_epipe epn; if (epp->fd [1] != epp->fd [0]) @@ -450,6 +462,7 @@ static int s_epipe_wait (s_epipe *epp) { + dTHX; #ifdef _WIN32 fd_set rfd; int fd = s_epipe_fd (epp); @@ -465,7 +478,7 @@ pfd.fd = s_epipe_fd (epp); pfd.events = POLLIN; - return poll (&pfd, 1, 0); + return poll (&pfd, 1, -1); #endif }