MEMBER_TO_FPTR(Perl_pp_ftis),
MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_fteowned */
MEMBER_TO_FPTR(Perl_pp_ftrowned),
- MEMBER_TO_FPTR(Perl_pp_ftzero),
+ MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftzero */
MEMBER_TO_FPTR(Perl_pp_ftis), /* Perl_pp_ftsize */
MEMBER_TO_FPTR(Perl_pp_ftis), /* Perl_pp_ftmtime */
MEMBER_TO_FPTR(Perl_pp_ftis), /* Perl_pp_ftatime */
MEMBER_TO_FPTR(Perl_pp_ftis), /* Perl_pp_ftctime */
- MEMBER_TO_FPTR(Perl_pp_ftsock),
- MEMBER_TO_FPTR(Perl_pp_ftchr),
- MEMBER_TO_FPTR(Perl_pp_ftblk),
- MEMBER_TO_FPTR(Perl_pp_ftfile),
- MEMBER_TO_FPTR(Perl_pp_ftdir),
- MEMBER_TO_FPTR(Perl_pp_ftpipe),
+ MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftsock */
+ MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftchr */
+ MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftblk */
+ MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftfile */
+ 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),
Perl_pp_ssockopt => ['gsockopt'],
Perl_pp_getpeername => ['getsockname'],
Perl_pp_stat => ['lstat'],
- Perl_pp_ftrowned => ['fteowned'],
+ Perl_pp_ftrowned => [qw(fteowned ftzero ftsock ftchr ftblk
+ ftfile ftdir ftpipe)],
Perl_pp_fttext => ['ftbinary'],
Perl_pp_gmtime => ['localtime'],
Perl_pp_semget => [qw(shmget msgget)],
SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
- if (PL_statcache.st_uid == (PL_op->op_type == OP_FTEOWNED ?
- PL_euid : PL_uid) )
- RETPUSHYES;
- RETPUSHNO;
-}
-
-PP(pp_ftzero)
-{
- I32 result;
- dSP;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
- if (PL_statcache.st_size == 0)
- RETPUSHYES;
- RETPUSHNO;
-}
-
-PP(pp_ftsock)
-{
- I32 result;
- dSP;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
- if (S_ISSOCK(PL_statcache.st_mode))
- RETPUSHYES;
- RETPUSHNO;
-}
-
-PP(pp_ftchr)
-{
- I32 result;
- dSP;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
- if (S_ISCHR(PL_statcache.st_mode))
- RETPUSHYES;
- RETPUSHNO;
-}
-
-PP(pp_ftblk)
-{
- I32 result;
- dSP;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
- if (S_ISBLK(PL_statcache.st_mode))
- RETPUSHYES;
- RETPUSHNO;
-}
-
-PP(pp_ftfile)
-{
- I32 result;
- dSP;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
- if (S_ISREG(PL_statcache.st_mode))
- RETPUSHYES;
- RETPUSHNO;
-}
-
-PP(pp_ftdir)
-{
- I32 result;
- dSP;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
- if (S_ISDIR(PL_statcache.st_mode))
- RETPUSHYES;
- RETPUSHNO;
-}
-
-PP(pp_ftpipe)
-{
- I32 result;
- dSP;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
- if (S_ISFIFO(PL_statcache.st_mode))
- RETPUSHYES;
+ switch (PL_op->op_type) {
+ case OP_FTROWNED:
+ if (PL_statcache.st_uid == PL_uid);
+ RETPUSHYES;
+ break;
+ case OP_FTEOWNED:
+ if (PL_statcache.st_uid == PL_euid)
+ RETPUSHYES;
+ break;
+ case OP_FTZERO:
+ if (PL_statcache.st_size == 0)
+ RETPUSHYES;
+ break;
+ case OP_FTSOCK:
+ if (S_ISSOCK(PL_statcache.st_mode))
+ RETPUSHYES;
+ break;
+ case OP_FTCHR:
+ if (S_ISCHR(PL_statcache.st_mode))
+ RETPUSHYES;
+ break;
+ case OP_FTBLK:
+ if (S_ISBLK(PL_statcache.st_mode))
+ RETPUSHYES;
+ break;
+ case OP_FTFILE:
+ if (S_ISREG(PL_statcache.st_mode))
+ RETPUSHYES;
+ break;
+ case OP_FTDIR:
+ if (S_ISDIR(PL_statcache.st_mode))
+ RETPUSHYES;
+ break;
+ case OP_FTPIPE:
+ if (S_ISFIFO(PL_statcache.st_mode))
+ RETPUSHYES;
+ break;
+ }
RETPUSHNO;
}