This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
unlink chmod utime kill can be merged into Perl_pp_chown().
authorNicholas Clark <nick@ccl4.org>
Wed, 2 Nov 2005 21:27:58 +0000 (21:27 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 2 Nov 2005 21:27:58 +0000 (21:27 +0000)
p4raw-id: //depot/perl@25964

mathoms.c
opcode.h
opcode.pl
pp_sys.c

index e814a80..6596037 100644 (file)
--- a/mathoms.c
+++ b/mathoms.c
@@ -921,6 +921,26 @@ PP(pp_ftsvtx)
     return pp_ftrowned();
 }
 
+PP(pp_unlink)
+{
+    return pp_chown();
+}
+
+PP(pp_chmod)
+{
+    return pp_chown();
+}
+
+PP(pp_utime)
+{
+    return pp_chown();
+}
+
+PP(pp_kill)
+{
+    return pp_chown();
+}
+
 U8 *
 Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv)
 {
index 090621c..196f0ec 100644 (file)
--- a/opcode.h
+++ b/opcode.h
@@ -1032,9 +1032,9 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */
        MEMBER_TO_FPTR(Perl_pp_chdir),
        MEMBER_TO_FPTR(Perl_pp_chown),
        MEMBER_TO_FPTR(Perl_pp_chroot),
-       MEMBER_TO_FPTR(Perl_pp_unlink),
-       MEMBER_TO_FPTR(Perl_pp_chmod),
-       MEMBER_TO_FPTR(Perl_pp_utime),
+       MEMBER_TO_FPTR(Perl_pp_chown),  /* Perl_pp_unlink */
+       MEMBER_TO_FPTR(Perl_pp_chown),  /* Perl_pp_chmod */
+       MEMBER_TO_FPTR(Perl_pp_chown),  /* Perl_pp_utime */
        MEMBER_TO_FPTR(Perl_pp_rename),
        MEMBER_TO_FPTR(Perl_pp_link),
        MEMBER_TO_FPTR(Perl_pp_symlink),
@@ -1052,7 +1052,7 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */
        MEMBER_TO_FPTR(Perl_pp_waitpid),
        MEMBER_TO_FPTR(Perl_pp_system),
        MEMBER_TO_FPTR(Perl_pp_exec),
-       MEMBER_TO_FPTR(Perl_pp_kill),
+       MEMBER_TO_FPTR(Perl_pp_chown),  /* Perl_pp_kill */
        MEMBER_TO_FPTR(Perl_pp_getppid),
        MEMBER_TO_FPTR(Perl_pp_getpgrp),
        MEMBER_TO_FPTR(Perl_pp_setpgrp),
index 7ac9922..921324c 100755 (executable)
--- a/opcode.pl
+++ b/opcode.pl
@@ -67,9 +67,9 @@ my @raw_alias = (
                 Perl_pp_gservent => [qw(gsbyname gsbyport)],
                 Perl_pp_gpwent => [qw(gpwnam gpwuid)],
                 Perl_pp_ggrent => [qw(ggrnam ggrgid)],
-
                 Perl_pp_ftis => [qw(ftsize ftmtime ftatime ftctime)],
-);
+                Perl_pp_chown => [qw(unlink chmod utime kill)],
+               );
 
 while (my ($func, $names) = splice @raw_alias, 0, 2) {
     $alias{$_} = $func for @$names;
index 52a2839..8682be3 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3456,7 +3456,7 @@ PP(pp_chdir)
 PP(pp_chown)
 {
     dSP; dMARK; dTARGET;
-    I32 value = (I32)apply(PL_op->op_type, MARK, SP);
+    const I32 value = (I32)apply(PL_op->op_type, MARK, SP);
 
     SP = MARK;
     PUSHi(value);
@@ -3476,36 +3476,6 @@ PP(pp_chroot)
 #endif
 }
 
-PP(pp_unlink)
-{
-    dSP; dMARK; dTARGET;
-    I32 value;
-    value = (I32)apply(PL_op->op_type, MARK, SP);
-    SP = MARK;
-    PUSHi(value);
-    RETURN;
-}
-
-PP(pp_chmod)
-{
-    dSP; dMARK; dTARGET;
-    I32 value;
-    value = (I32)apply(PL_op->op_type, MARK, SP);
-    SP = MARK;
-    PUSHi(value);
-    RETURN;
-}
-
-PP(pp_utime)
-{
-    dSP; dMARK; dTARGET;
-    I32 value;
-    value = (I32)apply(PL_op->op_type, MARK, SP);
-    SP = MARK;
-    PUSHi(value);
-    RETURN;
-}
-
 PP(pp_rename)
 {
     dSP; dTARGET;
@@ -4210,16 +4180,6 @@ PP(pp_exec)
     RETURN;
 }
 
-PP(pp_kill)
-{
-    dSP; dMARK; dTARGET;
-    I32 value;
-    value = (I32)apply(PL_op->op_type, MARK, SP);
-    SP = MARK;
-    PUSHi(value);
-    RETURN;
-}
-
 PP(pp_getppid)
 {
 #ifdef HAS_GETPPID