Remove tr///CU (the feature is to be obsoleted by better interfaces).
[p5sagit/p5-mst-13.2.git] / doio.c
diff --git a/doio.c b/doio.c
index 5c86537..970eaed 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -476,11 +476,13 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
            SV *sv;
 
            PerlLIO_dup2(PerlIO_fileno(fp), fd);
+           MUTEX_LOCK(&PL_fdpid_mutex);
            sv = *av_fetch(PL_fdpid,PerlIO_fileno(fp),TRUE);
            (void)SvUPGRADE(sv, SVt_IV);
            pid = SvIVX(sv);
            SvIVX(sv) = 0;
            sv = *av_fetch(PL_fdpid,fd,TRUE);
+           MUTEX_UNLOCK(&PL_fdpid_mutex);
            (void)SvUPGRADE(sv, SVt_IV);
            SvIVX(sv) = pid;
            if (!was_fdopen)
@@ -1794,8 +1796,11 @@ Perl_do_ipcctl(pTHX_ I32 optype, SV **mark, SV **sp)
        {
            struct semid_ds semds;
            union semun semun;
-
+#ifdef EXTRA_F_IN_SEMUN_BUF
+            semun.buff = &semds;
+#else
             semun.buf = &semds;
+#endif
            getinfo = (cmd == GETALL);
            if (Semctl(id, 0, IPC_STAT, semun) == -1)
                return -1;
@@ -1850,7 +1855,11 @@ Perl_do_ipcctl(pTHX_ I32 optype, SV **mark, SV **sp)
 #ifdef Semctl
             union semun unsemds;
 
+#ifdef EXTRA_F_IN_SEMUN_BUF
+            unsemds.buff = (struct semid_ds *)a;
+#else
             unsemds.buf = (struct semid_ds *)a;
+#endif
            ret = Semctl(id, n, cmd, unsemds);
 #else
            Perl_croak(aTHX_ "%s not implemented", PL_op_desc[optype]);
@@ -1919,6 +1928,10 @@ Perl_do_msgrcv(pTHX_ SV **mark, SV **sp)
     if (ret >= 0) {
        SvCUR_set(mstr, sizeof(long)+ret);
        *SvEND(mstr) = '\0';
+#ifndef INCOMPLETE_TAINTS
+       /* who knows who has been playing with this message? */
+       SvTAINTED_on(mstr);
+#endif
     }
     return ret;
 #else
@@ -1987,6 +2000,10 @@ Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp)
        SvCUR_set(mstr, msize);
        *SvEND(mstr) = '\0';
        SvSETMAGIC(mstr);
+#ifndef INCOMPLETE_TAINTS
+       /* who knows who has been playing with this shared memory? */
+       SvTAINTED_on(mstr);
+#endif
     }
     else {
        I32 n;