summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-11-02 20:13:24 +0000
committerNicholas Clark <nick@ccl4.org>2005-11-02 20:13:24 +0000
commit17ad201a5d2de952269cf4eeb85881a49a9c3867 (patch)
treeee40809b4d5c20c93112b92632bad7128dc11fef /pp_sys.c
parentf1cb2d481d972775b9a182636a99d99ab903f097 (diff)
downloadperl-17ad201a5d2de952269cf4eeb85881a49a9c3867.tar.gz
Move ftsuid ftsgid ftsvtx into Perl_pp_ftrowned.
p4raw-id: //depot/perl@25962
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c82
1 files changed, 34 insertions, 48 deletions
diff --git a/pp_sys.c b/pp_sys.c
index d005366d13..d932c2f837 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -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;
}