Tweaks to get Test::Builder::Tester's tests to work in the core.
[p5sagit/p5-mst-13.2.git] / cygwin / cygwin.c
index ceb2e81..03f48dd 100644 (file)
@@ -23,8 +23,8 @@ do_spawnvp (const char *path, const char * const *argv)
     Sigsave_t ihand,qhand;
     int childpid, result, status;
 
-    rsignal_save(SIGINT, SIG_IGN, &ihand);
-    rsignal_save(SIGQUIT, SIG_IGN, &qhand);
+    rsignal_save(SIGINT, (Sighandler_t) SIG_IGN, &ihand);
+    rsignal_save(SIGQUIT, (Sighandler_t) SIG_IGN, &qhand);
     childpid = spawnvp(_P_NOWAIT,path,argv);
     if (childpid < 0) {
        status = -1;
@@ -118,7 +118,7 @@ do_spawn (char *cmd)
            return do_spawnvp("sh",command);
        }
 
-    New (1303,PL_Argv,(s-cmd)/2+2,char*);
+    Newx (PL_Argv,(s-cmd)/2+2,char*);
     PL_Cmd=savepvn (cmd,s-cmd);
     a=PL_Argv;
     for (s=PL_Cmd; *s;) {
@@ -160,11 +160,14 @@ static
 XS(XS_Cygwin_pid_to_winpid)
 {
     dXSARGS;
+    dXSTARG;
+    pid_t pid, RETVAL;
+
     if (items != 1)
         Perl_croak(aTHX_ "Usage: Cygwin::pid_to_winpid(pid)");
-    pid_t pid = (pid_t)SvIV(ST(0));
-    pid_t RETVAL;
-    dXSTARG;
+
+    pid = (pid_t)SvIV(ST(0));
+
     if ((RETVAL = cygwin_internal(CW_CYGWIN_PID_TO_WINPID, pid)) > 0) {
        XSprePUSH; PUSHi((IV)RETVAL);
         XSRETURN(1);
@@ -176,11 +179,14 @@ static
 XS(XS_Cygwin_winpid_to_pid)
 {
     dXSARGS;
+    dXSTARG;
+    pid_t pid, RETVAL;
+
     if (items != 1)
         Perl_croak(aTHX_ "Usage: Cygwin::winpid_to_pid(pid)");
-    pid_t pid = (pid_t)SvIV(ST(0));
-    pid_t RETVAL;
-    dXSTARG;
+
+    pid = (pid_t)SvIV(ST(0));
+
     if ((RETVAL = cygwin32_winpid_to_pid(pid)) > 0) {
         XSprePUSH; PUSHi((IV)RETVAL);
         XSRETURN(1);