Skip to content

Commit f4c07e7

Browse files
committed
cleanup duplicated stat declarations in ext/phar
1 parent 5d1731b commit f4c07e7

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

ext/phar/func_interceptors.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -429,18 +429,6 @@ PHAR_FUNC(phar_fopen) /* {{{ */
429429
}
430430
/* }}} */
431431

432-
#ifndef S_ISDIR
433-
#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR)
434-
#endif
435-
#ifndef S_ISREG
436-
#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG)
437-
#endif
438-
#ifndef S_ISLNK
439-
#define S_ISLNK(mode) (((mode)&S_IFMT) == S_IFLNK)
440-
#endif
441-
442-
#define S_IXROOT ( S_IXUSR | S_IXGRP | S_IXOTH )
443-
444432
#define IS_LINK_OPERATION(__t) ((__t) == FS_TYPE || (__t) == FS_IS_LINK || (__t) == FS_LSTAT)
445433
#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)
446434
#define IS_ABLE_CHECK(__t) ((__t) == FS_IS_R || (__t) == FS_IS_W || (__t) == FS_IS_X)

ext/phar/tar.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,7 @@ int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias,
460460
entry.flags = phar_tar_number(hdr->mode, sizeof(hdr->mode)) & PHAR_ENT_PERM_MASK;
461461
entry.timestamp = phar_tar_number(hdr->mtime, sizeof(hdr->mtime));
462462
entry.is_persistent = myphar->is_persistent;
463-
#ifndef S_ISDIR
464-
#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR)
465-
#endif
463+
466464
if (old && entry.tar_type == TAR_FILE && S_ISDIR(entry.flags)) {
467465
entry.tar_type = TAR_DIR;
468466
}

0 commit comments

Comments
 (0)