diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-07-11 17:36:42 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-07-11 17:36:42 +0000 |
commit | 3d35f11b2518ea9ea787f5db97c6c3e7cff04dbf (patch) | |
tree | 734aa6592529265daf086a04e80910a6ed0c7650 /vmesa | |
parent | f3b469aff5df6578898d16737a9550f4e9b8ee54 (diff) | |
download | perl-3d35f11b2518ea9ea787f5db97c6c3e7cff04dbf.tar.gz |
integrate cfgperl changes#6207..6210 into mainline
p4raw-link: @6210 on //depot/cfgperl: b8b4c9f3cf6ef09c878a80ff97526a69902a44ca
p4raw-link: @6207 on //depot/cfgperl: b37a7757477319a5fcdd5131db15046064f631c4
p4raw-id: //depot/perl@6345
Diffstat (limited to 'vmesa')
-rw-r--r-- | vmesa/vmesa.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/vmesa/vmesa.c b/vmesa/vmesa.c index 0e7894aeb9..b39638086f 100644 --- a/vmesa/vmesa.c +++ b/vmesa/vmesa.c @@ -182,11 +182,13 @@ do_aspawn(SV* really, SV **mark, SV **sp) /* be used by my_pclose */ /*---------------------------------------------*/ close(fd); + FDPID_LOCK; p_sv = av_fetch(PL_fdpid,fd,TRUE); fd = (int) SvIVX(*p_sv); SvREFCNT_dec(*p_sv); *p_sv = &PL_sv_undef; sv = *av_fetch(PL_fdpid,fd,TRUE); + FDPID_UNLOCK; (void) SvUPGRADE(sv, SVt_IV); SvIVX(sv) = pid; status = 0; @@ -408,11 +410,13 @@ my_popen(char *cmd, char *mode) Perl_stdin_fd = pFd[that]; if (strNE(cmd,"-")) { - PERL_FLUSHALL_FOR_CHILD; + PERL_FLUSHALL_FOR_CHILD; pid = spawn_cmd(cmd, Perl_stdin_fd, Perl_stdout_fd); if (pid >= 0) { + FDPID_LOCK; sv = *av_fetch(PL_fdpid,pFd[this],TRUE); + FDPID_UNLOCK; (void) SvUPGRADE(sv, SVt_IV); SvIVX(sv) = pid; fd = PerlIO_fdopen(pFd[this], mode); @@ -423,7 +427,9 @@ my_popen(char *cmd, char *mode) } else { + FDPID_LOCK; sv = *av_fetch(PL_fdpid,pFd[that],TRUE); + FDPID_UNLOCK; (void) SvUPGRADE(sv, SVt_IV); SvIVX(sv) = pFd[this]; fd = PerlIO_fdopen(pFd[this], mode); @@ -460,7 +466,9 @@ my_pclose(FILE *fp) SV **sv; FILE *other; + FDPID_LOCK; sv = av_fetch(PL_fdpid,PerlIO_fileno(fp),TRUE); + FDPID_UNLOCK; pid = (int) SvIVX(*sv); SvREFCNT_dec(*sv); *sv = &PL_sv_undef; |