perl 5.003_01: lib/ExtUtils/xsubpp
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index 4608a2a..ba1f105 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -365,7 +365,7 @@ PP(pp_binmode)
 
 #ifdef DOSISH
 #ifdef atarist
-    if (!fflush(fp) && (fp->_flag |= _IOBIN))
+    if (!Fflush(fp) && (fp->_flag |= _IOBIN))
        RETPUSHYES;
     else
        RETPUSHUNDEF;
@@ -420,7 +420,7 @@ PP(pp_tie)
     PUTBACK;
 
     if (op = pp_entersub())
-        run();
+        runops();
     SPAGAIN;
 
     sv = TOPs;
@@ -452,7 +452,7 @@ PP(pp_untie)
 
 PP(pp_tied)
 {
-    dSP; dTARGET ;
+    dSP;
     SV * sv ;
     MAGIC * mg ;
 
@@ -518,7 +518,7 @@ PP(pp_dbmopen)
     PUTBACK;
 
     if (op = pp_entersub())
-        run();
+        runops();
     SPAGAIN;
 
     if (!sv_isobject(TOPs)) {
@@ -535,7 +535,7 @@ PP(pp_dbmopen)
        PUTBACK;
 
        if (op = pp_entersub())
-           run();
+           runops();
        SPAGAIN;
     }
 
@@ -919,7 +919,7 @@ PP(pp_leavewrite)
            SvCUR_set(formtarget, 0);
            *SvEND(formtarget) = '\0';
            if (IoFLAGS(io) & IOf_FLUSH)
-               (void)fflush(fp);
+               (void)Fflush(fp);
            PUSHs(&sv_yes);
        }
     }
@@ -965,7 +965,7 @@ PP(pp_prtf)
            goto just_say_no;
 
        if (IoFLAGS(io) & IOf_FLUSH)
-           if (fflush(fp) == EOF)
+           if (Fflush(fp) == EOF)
                goto just_say_no;
     }
     SvREFCNT_dec(sv);
@@ -982,9 +982,8 @@ PP(pp_prtf)
 
 PP(pp_sysopen)
 {
-    dSP; dTARGET;
+    dSP;
     GV *gv;
-    IO *io;
     SV *sv;
     char *tmps;
     STRLEN len;
@@ -1966,7 +1965,7 @@ PP(pp_ftmtime)
     dSP; dTARGET;
     if (result < 0)
        RETPUSHUNDEF;
-    PUSHn( (basetime - statcache.st_mtime) / 86400.0 );
+    PUSHn( ((I32)basetime - (I32)statcache.st_mtime) / 86400.0 );
     RETURN;
 }
 
@@ -1976,7 +1975,7 @@ PP(pp_ftatime)
     dSP; dTARGET;
     if (result < 0)
        RETPUSHUNDEF;
-    PUSHn( (basetime - statcache.st_atime) / 86400.0 );
+    PUSHn( ((I32)basetime - (I32)statcache.st_atime) / 86400.0 );
     RETURN;
 }
 
@@ -1986,7 +1985,7 @@ PP(pp_ftctime)
     dSP; dTARGET;
     if (result < 0)
        RETPUSHUNDEF;
-    PUSHn( (basetime - statcache.st_ctime) / 86400.0 );
+    PUSHn( ((I32)basetime - (I32)statcache.st_ctime) / 86400.0 );
     RETURN;
 }
 
@@ -2771,7 +2770,7 @@ PP(pp_system)
     Signal_t (*ihand)();     /* place to save signal during system() */
     Signal_t (*qhand)();     /* place to save signal during system() */
 
-#if defined(HAS_FORK) && !defined(VMS)
+#if defined(HAS_FORK) && !defined(VMS) && !defined(OS2)
     if (SP - MARK == 1) {
        if (tainting) {
            char *junk = SvPV(TOPs, na);
@@ -2817,7 +2816,7 @@ PP(pp_system)
        value = (I32)do_exec(SvPVx(sv_mortalcopy(*SP), na));
     }
     _exit(-1);
-#else /* ! FORK or VMS */
+#else /* ! FORK or VMS or OS/2 */
     if (op->op_flags & OPf_STACKED) {
        SV *really = *++MARK;
        value = (I32)do_aspawn(really, MARK, SP);
@@ -2903,8 +2902,8 @@ PP(pp_getpgrp)
        pid = 0;
     else
        pid = SvIVx(POPs);
-#ifdef USE_BSDPGRP
-    value = (I32)getpgrp(pid);
+#ifdef BSD_GETPGRP
+    value = (I32)BSD_GETPGRP(pid);
 #else
     if (pid != 0)
        DIE("POSIX getpgrp can't take an argument");
@@ -2933,8 +2932,8 @@ PP(pp_setpgrp)
     }
 
     TAINT_PROPER("setpgrp");
-#ifdef USE_BSDPGRP
-    SETi( setpgrp(pid, pgrp) >= 0 );
+#ifdef BSD_SETPGRP
+    SETi( BSD_SETPGRP(pid, pgrp) >= 0 );
 #else
     if ((pgrp != 0) || (pid != 0)) {
        DIE("POSIX setpgrp can't take an argument");