Make harness warning-free when running with -Mdiagnostics
[p5sagit/p5-mst-13.2.git] / doio.c
diff --git a/doio.c b/doio.c
index c82740c..0af6a0a 100644 (file)
--- 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); }                         \