diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-04-06 16:10:59 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-04-06 16:10:59 +0000 |
commit | 353d08e5f7078ba4e7b574dfbc54450fbb993154 (patch) | |
tree | 2bb7cdada2008515f3789196469eca4e9b79fa8b /gnu/usr.bin/perl | |
parent | 046e115b0085c8555ec9eb2baf0dcd7f58048cf8 (diff) |
virgin perl 5.6.0
Diffstat (limited to 'gnu/usr.bin/perl')
-rw-r--r-- | gnu/usr.bin/perl/vmesa/vmesa.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/gnu/usr.bin/perl/vmesa/vmesa.c b/gnu/usr.bin/perl/vmesa/vmesa.c index 59dd19b6c1a..0e7894aeb95 100644 --- a/gnu/usr.bin/perl/vmesa/vmesa.c +++ b/gnu/usr.bin/perl/vmesa/vmesa.c @@ -121,7 +121,8 @@ do_aspawn(SV* really, SV **mark, SV **sp) status = FAIL; if (sp > mark) { - Newx(PL_Argv, sp - mark + 1, char*); + dTHR; + New(401,PL_Argv, sp - mark + 1, char*); a = PL_Argv; while (++mark <= sp) { @@ -136,7 +137,7 @@ do_aspawn(SV* really, SV **mark, SV **sp) fdMap[STDOUT_FILENO] = Perl_stdout_fd; fdMap[STDERR_FILENO] = STDERR_FILENO; nFd = 3; - *a = NULL; + *a = Nullch; /*-----------------------------------------------------*/ /* Will execvp() use PATH? */ /*-----------------------------------------------------*/ @@ -181,13 +182,11 @@ do_aspawn(SV* really, SV **mark, SV **sp) /* be used by my_pclose */ /*---------------------------------------------*/ close(fd); - MUTEX_LOCK(&PL_fdpid_mutex); 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); - MUTEX_UNLOCK(&PL_fdpid_mutex); (void) SvUPGRADE(sv, SVt_IV); SvIVX(sv) = pid; status = 0; @@ -260,7 +259,7 @@ do_spawn(char *cmd, int execf) } } - Newx(PL_Argv, (s - cmd) / 2 + 2, char*); + New(402,PL_Argv, (s - cmd) / 2 + 2, char*); PL_Cmd = savepvn(cmd, s-cmd); a = PL_Argv; for (s = PL_Cmd; *s;) @@ -272,7 +271,7 @@ do_spawn(char *cmd, int execf) if (*s) *s++ = '\0'; } - *a = NULL; + *a = Nullch; fdMap[STDIN_FILENO] = Perl_stdin_fd; fdMap[STDOUT_FILENO] = Perl_stdout_fd; fdMap[STDERR_FILENO] = STDERR_FILENO; @@ -285,6 +284,7 @@ do_spawn(char *cmd, int execf) (const char **) environ); if (pid < 0) { + dTHR; status = FAIL; if (ckWARN(WARN_EXEC)) warner(WARN_EXEC,"Can't exec \"%s\": %s", @@ -408,33 +408,29 @@ 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) { - MUTEX_LOCK(&PL_fdpid_mutex); sv = *av_fetch(PL_fdpid,pFd[this],TRUE); - MUTEX_UNLOCK(&PL_fdpid_mutex); (void) SvUPGRADE(sv, SVt_IV); SvIVX(sv) = pid; fd = PerlIO_fdopen(pFd[this], mode); close(pFd[that]); } else - fd = NULL; + fd = Nullfp; } else { - MUTEX_LOCK(&PL_fdpid_mutex); sv = *av_fetch(PL_fdpid,pFd[that],TRUE); - MUTEX_UNLOCK(&PL_fdpid_mutex); (void) SvUPGRADE(sv, SVt_IV); SvIVX(sv) = pFd[this]; fd = PerlIO_fdopen(pFd[this], mode); } } else - fd = NULL; + fd = Nullfp; return (fd); } @@ -464,9 +460,7 @@ my_pclose(FILE *fp) SV **sv; FILE *other; - MUTEX_LOCK(&PL_fdpid_mutex); sv = av_fetch(PL_fdpid,PerlIO_fileno(fp),TRUE); - MUTEX_UNLOCK(&PL_fdpid_mutex); pid = (int) SvIVX(*sv); SvREFCNT_dec(*sv); *sv = &PL_sv_undef; |