From: Nicholas Clark Date: Wed, 2 Nov 2005 20:59:52 +0000 (+0000) Subject: Move the conditonal compiles that report absence of kill and chown X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1444765efaefee475386d81c393f3e679a455714;p=p5sagit%2Fp5-mst-13.2.git Move the conditonal compiles that report absence of kill and chown from pp_kill() and pp_chown() into apply(). p4raw-id: //depot/perl@25963 --- diff --git a/doio.c b/doio.c index c82740c..0af6a0a 100644 --- a/doio.c +++ b/doio.c @@ -1572,6 +1572,19 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp) const char *s; SV ** const oldmark = mark; + /* Doing this ahead of the switch statement preserves the old behaviour, + where attempting to use kill as a taint test test would fail on + platforms where kill was not defined. */ +#ifndef HAS_KILL + if (type == OP_KILL) + DIE(aTHX_ PL_no_func, "kill"); +#endif +#ifndef HAS_CHOWN + if (type == OP_CHOWN) + DIE(aTHX_ PL_no_func, "chown"); +#endif + + #define APPLY_TAINT_PROPER() \ STMT_START { \ if (PL_tainted) { TAINT_PROPER(what); } \ diff --git a/pp_sys.c b/pp_sys.c index d932c2f..52a2839 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -3455,16 +3455,12 @@ PP(pp_chdir) PP(pp_chown) { -#ifdef HAS_CHOWN dSP; dMARK; dTARGET; I32 value = (I32)apply(PL_op->op_type, MARK, SP); SP = MARK; PUSHi(value); RETURN; -#else - DIE(aTHX_ PL_no_func, "chown"); -#endif } PP(pp_chroot) @@ -4216,16 +4212,12 @@ PP(pp_exec) PP(pp_kill) { -#ifdef HAS_KILL dSP; dMARK; dTARGET; I32 value; value = (I32)apply(PL_op->op_type, MARK, SP); SP = MARK; PUSHi(value); RETURN; -#else - DIE(aTHX_ PL_no_func, "kill"); -#endif } PP(pp_getppid)