From: Jarkko Hietaniemi Date: Mon, 19 Nov 2001 13:28:22 +0000 (+0000) Subject: do_spawn() cleanup from Charles Lane. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=209030dfb82e17eb9572fa3fbdde2effbf80b651;p=p5sagit%2Fp5-mst-13.2.git do_spawn() cleanup from Charles Lane. p4raw-id: //depot/perl@13087 --- diff --git a/vms/vms.c b/vms/vms.c index 0884863..86171d3 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -5101,36 +5101,34 @@ Perl_do_aspawn(pTHX_ void *really,void **mark,void **sp) unsigned long int Perl_do_spawn(pTHX_ char *cmd) { - unsigned long int sts, substs, hadcmd = 1; + unsigned long int sts, substs; TAINT_ENV(); TAINT_PROPER("spawn"); if (!cmd || !*cmd) { - hadcmd = 0; sts = lib$spawn(0,0,0,0,0,0,&substs,0,0,0,0,0,0); if (!(sts & 1)) { switch (sts) { - case RMS$_FNF: case RMS$_DNF: - set_errno(ENOENT); break; - case RMS$_DIR: - set_errno(ENOTDIR); break; - case RMS$_DEV: - set_errno(ENODEV); break; - case RMS$_PRV: - set_errno(EACCES); break; - case RMS$_SYN: - set_errno(EINVAL); break; - case CLI$_BUFOVF: case RMS$_RTB: case CLI$_TKNOVF: case CLI$_RSLOVF: - set_errno(E2BIG); break; - case LIB$_INVARG: case LIB$_INVSTRDES: case SS$_ACCVIO: /* shouldn't happen */ - _ckvmssts(sts); /* fall through */ - default: /* SS$_DUPLNAM, SS$_CLI, resource exhaustion, etc. */ - set_errno(EVMSERR); + case RMS$_FNF: case RMS$_DNF: + set_errno(ENOENT); break; + case RMS$_DIR: + set_errno(ENOTDIR); break; + case RMS$_DEV: + set_errno(ENODEV); break; + case RMS$_PRV: + set_errno(EACCES); break; + case RMS$_SYN: + set_errno(EINVAL); break; + case CLI$_BUFOVF: case RMS$_RTB: case CLI$_TKNOVF: case CLI$_RSLOVF: + set_errno(E2BIG); break; + case LIB$_INVARG: case LIB$_INVSTRDES: case SS$_ACCVIO: /* shouldn't happen */ + _ckvmssts(sts); /* fall through */ + default: /* SS$_DUPLNAM, SS$_CLI, resource exhaustion, etc. */ + set_errno(EVMSERR); } set_vaxc_errno(sts); if (ckWARN(WARN_EXEC)) { - Perl_warner(aTHX_ WARN_EXEC,"Can't spawn \"%s\": %s", - hadcmd ? cmd : "", + Perl_warner(aTHX_ WARN_EXEC,"Can't spawn: %s", Strerror(errno)); } } @@ -5139,10 +5137,7 @@ Perl_do_spawn(pTHX_ char *cmd) else { (void) safe_popen(cmd, "nW", (int *)&sts); } - - vms_execfree(aTHX); return sts; - } /* end of do_spawn() */ /*}}}*/