diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-11-02 20:13:24 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-11-02 20:13:24 +0000 |
commit | 17ad201a5d2de952269cf4eeb85881a49a9c3867 (patch) | |
tree | ee40809b4d5c20c93112b92632bad7128dc11fef | |
parent | f1cb2d481d972775b9a182636a99d99ab903f097 (diff) | |
download | perl-17ad201a5d2de952269cf4eeb85881a49a9c3867.tar.gz |
Move ftsuid ftsgid ftsvtx into Perl_pp_ftrowned.
p4raw-id: //depot/perl@25962
-rw-r--r-- | mathoms.c | 15 | ||||
-rw-r--r-- | opcode.h | 6 | ||||
-rwxr-xr-x | opcode.pl | 3 | ||||
-rw-r--r-- | pp_sys.c | 82 |
4 files changed, 54 insertions, 52 deletions
@@ -906,6 +906,21 @@ PP(pp_ftpipe) return pp_ftrowned(); } +PP(pp_ftsuid) +{ + return pp_ftrowned(); +} + +PP(pp_ftsgid) +{ + return pp_ftrowned(); +} + +PP(pp_ftsvtx) +{ + return pp_ftrowned(); +} + U8 * Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv) { @@ -1023,9 +1023,9 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */ MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftdir */ MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftpipe */ MEMBER_TO_FPTR(Perl_pp_ftlink), - MEMBER_TO_FPTR(Perl_pp_ftsuid), - MEMBER_TO_FPTR(Perl_pp_ftsgid), - MEMBER_TO_FPTR(Perl_pp_ftsvtx), + MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftsuid */ + MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftsgid */ + MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftsvtx */ MEMBER_TO_FPTR(Perl_pp_fttty), MEMBER_TO_FPTR(Perl_pp_fttext), MEMBER_TO_FPTR(Perl_pp_fttext), /* Perl_pp_ftbinary */ @@ -54,7 +54,8 @@ my @raw_alias = ( Perl_pp_getpeername => ['getsockname'], Perl_pp_stat => ['lstat'], Perl_pp_ftrowned => [qw(fteowned ftzero ftsock ftchr ftblk - ftfile ftdir ftpipe)], + ftfile ftdir ftpipe ftsuid ftsgid + ftsvtx)], Perl_pp_fttext => ['ftbinary'], Perl_pp_gmtime => ['localtime'], Perl_pp_semget => [qw(shmget msgget)], @@ -3085,6 +3085,22 @@ PP(pp_ftrowned) { I32 result; dSP; + + /* I believe that all these three are likely to be defined on most every + system these days. */ +#ifndef S_ISUID + if(PL_op->op_type == OP_FTSUID) + RETPUSHNO; +#endif +#ifndef S_ISGID + if(PL_op->op_type == OP_FTSGID) + RETPUSHNO; +#endif +#ifndef S_ISVTX + if(PL_op->op_type == OP_FTSVTX) + RETPUSHNO; +#endif + STACKED_FTEST_CHECK; result = my_stat(); SPAGAIN; @@ -3127,66 +3143,36 @@ PP(pp_ftrowned) if (S_ISFIFO(PL_statcache.st_mode)) RETPUSHYES; break; - } - RETPUSHNO; -} - -PP(pp_ftlink) -{ - I32 result = my_lstat(); - dSP; - if (result < 0) - RETPUSHUNDEF; - if (S_ISLNK(PL_statcache.st_mode)) - RETPUSHYES; - RETPUSHNO; -} - -PP(pp_ftsuid) -{ - dSP; #ifdef S_ISUID - I32 result; - STACKED_FTEST_CHECK; - result = my_stat(); - SPAGAIN; - if (result < 0) - RETPUSHUNDEF; - if (PL_statcache.st_mode & S_ISUID) - RETPUSHYES; + case OP_FTSUID: + if (PL_statcache.st_mode & S_ISUID) + RETPUSHYES; + break; #endif - RETPUSHNO; -} - -PP(pp_ftsgid) -{ - dSP; #ifdef S_ISGID - I32 result; - STACKED_FTEST_CHECK; - result = my_stat(); - SPAGAIN; - if (result < 0) - RETPUSHUNDEF; - if (PL_statcache.st_mode & S_ISGID) - RETPUSHYES; + case OP_FTSGID: + if (PL_statcache.st_mode & S_ISGID) + RETPUSHYES; + break; +#endif +#ifdef S_ISVTX + case OP_FTSVTX: + if (PL_statcache.st_mode & S_ISVTX) + RETPUSHYES; + break; #endif + } RETPUSHNO; } -PP(pp_ftsvtx) +PP(pp_ftlink) { + I32 result = my_lstat(); dSP; -#ifdef S_ISVTX - I32 result; - STACKED_FTEST_CHECK; - result = my_stat(); - SPAGAIN; if (result < 0) RETPUSHUNDEF; - if (PL_statcache.st_mode & S_ISVTX) + if (S_ISLNK(PL_statcache.st_mode)) RETPUSHYES; -#endif RETPUSHNO; } |