This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge the implementations of POSIX::{access,mkfifo} using ALIAS.
authorNicholas Clark <nick@ccl4.org>
Fri, 9 Sep 2011 21:25:08 +0000 (23:25 +0200)
committerNicholas Clark <nick@ccl4.org>
Tue, 13 Sep 2011 09:28:09 +0000 (11:28 +0200)
ext/POSIX/POSIX.xs

index e09454d..7284299 100644 (file)
@@ -1704,9 +1704,15 @@ SysRet
 mkfifo(filename, mode)
        char *          filename
        Mode_t          mode
+    ALIAS:
+       access = 1
     CODE:
-       TAINT_PROPER("mkfifo");
-       RETVAL = mkfifo(filename, mode);
+       if(ix) {
+           RETVAL = access(filename, mode);
+       } else {
+           TAINT_PROPER("mkfifo");
+           RETVAL = mkfifo(filename, mode);
+       }
     OUTPUT:
        RETVAL
 
@@ -1859,11 +1865,6 @@ tzname()
        PUSHs(newSVpvn_flags(tzname[0], strlen(tzname[0]), SVs_TEMP));
        PUSHs(newSVpvn_flags(tzname[1], strlen(tzname[1]), SVs_TEMP));
 
-SysRet
-access(filename, mode)
-       char *          filename
-       Mode_t          mode
-
 char *
 ctermid(s = 0)
        char *          s = 0;