com php-src: cleanup duplicated stat declarations in ext/phar: ext/phar/func_interceptors.c ext/phar/tar.c
| From: | Anatol Belski | Date: | Mon, 25 May 2015 16:03:22 +0000 |
| Subject: | com php-src: cleanup duplicated stat declarations in ext/phar: ext/phar/func_interceptors.c ext/phar/tar.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86910@lists.php.net to get a copy of this message | ||
Commit: f4c07e7e76182605f17848b6af3b41ee51039dc7
Author: Anatol Belski <ab@php.net> Mon, 25 May 2015 13:21:01 +0200
Parents: 5d1731b2fb5a2ed96fffddd9d3d5c3d1ae502eba
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f4c07e7e76182605f17848b6af3b41ee51039dc7
Log:
cleanup duplicated stat declarations in ext/phar
Changed paths:
M ext/phar/func_interceptors.c
M ext/phar/tar.c
Diff:
diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c
index 8cadeb5..c491264 100644
--- a/ext/phar/func_interceptors.c
+++ b/ext/phar/func_interceptors.c
@@ -429,18 +429,6 @@ skip_phar:
}
/* }}} */
-#ifndef S_ISDIR
-#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR)
-#endif
-#ifndef S_ISREG
-#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG)
-#endif
-#ifndef S_ISLNK
-#define S_ISLNK(mode) (((mode)&S_IFMT) == S_IFLNK)
-#endif
-
-#define S_IXROOT ( S_IXUSR | S_IXGRP | S_IXOTH )
-
#define IS_LINK_OPERATION(__t) ((__t) == FS_TYPE || (__t) == FS_IS_LINK || (__t) == FS_LSTAT)
#define IS_EXISTS_CHECK(__t) ((__t) == FS_EXISTS || (__t) == FS_IS_W || (__t) == FS_IS_R || (__t)
== FS_IS_X || (__t) == FS_IS_FILE || (__t) == FS_IS_DIR || (__t) == FS_IS_LINK)
#define IS_ABLE_CHECK(__t) ((__t) == FS_IS_R || (__t) == FS_IS_W || (__t) == FS_IS_X)
diff --git a/ext/phar/tar.c b/ext/phar/tar..c
index 81b08de..52df819 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -460,9 +460,7 @@ bail:
entry.flags = phar_tar_number(hdr->mode, sizeof(hdr->mode)) & PHAR_ENT_PERM_MASK;
entry.timestamp = phar_tar_number(hdr->mtime, sizeof(hdr->mtime));
entry.is_persistent = myphar->is_persistent;
-#ifndef S_ISDIR
-#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR)
-#endif
+
if (old && entry.tar_type == TAR_FILE && S_ISDIR(entry.flags)) {
entry.tar_type = TAR_DIR;
}