Re: cvs: php4 /main php_ini.c
| From: | (Marcus Börger) | Date: | Sat, 22 Jun 2002 12:43:58 +0000 |
| Subject: | Re: cvs: php4 /main php_ini.c | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-12439@lists.php.net to get a copy of this message | ||
finally i have my pending patch (has some time today and a working linux again)
BUT i do not have karma for TSRM as guessed by Yasuo
Tested on linux & cygwin, somebody with MSVC6 can check this please?
cvs -z3 -q diff ext\standard\filestat.c main\php_ini.c TSRM\tsrm_virtual_cwd.c TSRM\tsrm_virtual_cwd.h (in directory S:\php4\)
Index: ext/standard/filestat.c
===================================================================
RCS file: /repository/php4/ext/standard/filestat.c,v
retrieving revision 1.94
diff -u -r1.94 filestat.c
--- ext/standard/filestat.c 20 May 2002 17:41:35 -0000 1.94 +++ ext/standard/filestat.c 22 Jun 2002 12:34:24 -0000@@ -78,16 +78,6 @@ #include "basic_functions.h" #include "php_filestat.h" -#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 ) /* Switches for various filestat functions: */ Index: main/php_ini.c =================================================================== RCS file: /repository/php4/main/php_ini.c,v retrieving revision 1.95 diff -u -r1.95 php_ini.c
--- main/php_ini.c 19 May 2002 14:45:31 -0000 1.95 +++ main/php_ini.c 22 Jun 2002 12:34:24 -0000@@ -304,7 +304,7 @@
struct stat statbuf;
if (!VCWD_STAT(sapi_module.php_ini_path_override, &statbuf)) {
- if (!((statbuf.st_mode & S_IFMT) == S_IFDIR)) {
+ if (!S_ISDIR(statbuf.st_mode)) {
fh.handle.fp = VCWD_FOPEN(sapi_module.php_ini_path_override, "r");
fh.filename = sapi_module.php_ini_path_override;
}
Index: TSRM/tsrm_virtual_cwd.c
===================================================================
RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v
retrieving revision 1.30
diff -u -r1.30 tsrm_virtual_cwd.c
--- TSRM/tsrm_virtual_cwd.c 29 May 2002 08:41:21 -0000 1.30 +++ TSRM/tsrm_virtual_cwd.c 22 Jun 2002 12:34:24 -0000@@ -64,14 +64,6 @@ #include <direct.h> #endif -#ifndef S_ISDIR -#define S_ISDIR(mode) ((mode) & _S_IFDIR) -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) ((mode) & _S_IFREG) -#endif - #ifdef TSRM_WIN32 #include <tchar.h> #define tsrm_strtok_r(a,b,c) _tcstok((a),(b)) Index: TSRM/tsrm_virtual_cwd.h =================================================================== RCS file: /repository/TSRM/tsrm_virtual_cwd.h,v retrieving revision 1.19 diff -u -r1.19 tsrm_virtual_cwd.h
--- TSRM/tsrm_virtual_cwd.h 29 May 2002 08:41:21 -0000 1.19 +++ TSRM/tsrm_virtual_cwd.h 22 Jun 2002 12:34:24 -0000@@ -238,4 +238,23 @@ #endif +#ifndef S_ISDIR +#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) +#endif +#ifndef S_ISCHR +#define S_ISCHR(mode) (((mode)&S_IFMT) == S_IFCHR) +#endif +#ifndef S_ISFIFO +#define S_ISFIFO(mode) (((mode)&S_IFMT) == S_IFIFO) +#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 +#ifndef S_ISBLK +#define S_ISBLK(mode) (((mode)&S_IFMT) == S_IFBLK) +#endif + #endif /* VIRTUAL_CWD_H */ At 05:54 21.04.2002, Yasuo Ohgaki wrote:
Sascha Schumann wrote:+1 You have access to both TSRM and php4. TSRM seems to be better choice, since both Zend and php4 uses TSRM. It's your choice. -- Yasuo Ohgaki -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpThe ``S_ISDIR´´ macro is a POSIX interface and should be used by the PHP source code, because it is simply the right thing to do. I don't see any need to invent a new name for it, especially because it is unrelated to and independent of the virtual directory concept. I'd encourage defining ``S_ISDIR´´ in a central header file, so that the full source code base can benefit of it.