Re: cvs: php4 /main php_ini.c
| From: | (Marcus Börger) | Date: | Sat, 20 Apr 2002 17:56:28 +0000 |
| Subject: | Re: cvs: php4 /main php_ini.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-11275@lists.php.net to get a copy of this message | ||
At 02:41 20.04.2002, Yasuo Ohgaki wrote:
Marcus Börger wrote:I had a look and found that VCWD_* are defined in tsrm_virtual_cwd.h. So perhaps we should name the macros VCWD_IS* instead of S_IS* or STAT_IS* and place them in the same directory (Andi/Sascha)? marcusNow that i see what you meant and what you did i have an objection! The macro S_ISDIR is normally defined to enable changes in the structure and therefor make type detection independent of the actual struct layout. If you consider the different occurances for the structure and the many filesystems that exist and the many platforms and ... i think it would be better to keep it or to add a define our own: #ifdef S_ISDIR #define STAT_ISDIR(m) S_ISDIR(m) #else #define STAT_ISDIR(m) ((m.st_mode & S_IFMT) == S_IFDIR) #endifSounds good to me. We probably better to define macro in php.h or like. Do you have any idea where it should be?
-- Yasuo Ohgakimakes diff:-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php- if (!((statbuf.st_mode & S_IFMT) == S_IFDIR)) { + if (!STAT_ISDIR(statbuf)) {And before anybody else falls over it we should add the other missing defines also:#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) #define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) #define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO) #define S_ISREG(m) (((m)&S_IFMT) == S_IFREG) #define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK) #define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK)marcus At 07:48 19.04.2002, Yasuo Ohgaki wrote:yohgaki Fri Apr 19 01:48:24 2002 EDTModified files:/php4/main php_ini.cLog: Avoid defining/using S_ISDIR macro. Index: php4/main/php_ini.c diff -u php4/main/php_ini.c:1.84 php4/main/php_ini.c:1.85--- php4/main/php_ini.c:1.84 Wed Apr 17 13:25:18 2002+++ php4/main/php_ini.c Fri Apr 19 01:48:22 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_ini.c,v 1.84 2002/04/17 17:25:18 sebastian Exp $ */ +/* $Id: php_ini.c,v 1.85 2002/04/19 05:48:22 yohgaki Exp $ */ #include "php.h" #ifndef PHP_WIN32 @@ -31,10 +31,6 @@ #include "SAPI.h" #include "php_main.h" -#ifndef S_ISDIR-#define S_ISDIR( m ) (((m) & S_IFMT) == S_IFDIR)-#endif - typedef struct _php_extension_lists {zend_llist engine; zend_llist functions;@@ -272,7 +268,7 @@if (php_ini_path_override && php_ini_path_override[0]) { struct stat statbuf; if (!VCWD_STAT(php_ini_path_override, &statbuf)) { - if (!S_ISDIR(statbuf.st_mode)) { + if (!((statbuf.st_mode & S_IFMT) == S_IFDIR)) { fh.handle.fp = VCWD_FOPEN(php_ini_path_override, "r"); } }-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php