From 55518f5360986573ffb5a000b342924664d3b3bc Mon Sep 17 00:00:00 2001 From: Anantha Kesari H Y Date: Fri, 15 Jul 2005 09:29:19 +0000 Subject: [PATCH] ext/standard/file.h NetWare LibC has fnmatch and realpath implemented. ext/standard/filestat.c Removing redundant CLIB_STAT_PATCH and fixing some NetWare specific stat structure. ext/standard/link.c Removing redundant CLIB_STAT_PATCH. ext/standard/pageinfo.c Removing redundant CLIB_STAT_PATCH and fixing some NetWare specific stat structure. ext/standard/syslog.c Except LOG_SYSLOG NetWare LibC has other macros defined. -- Kamesh --- ext/standard/file.h | 2 +- ext/standard/filestat.c | 14 +++----------- ext/standard/link.c | 4 ---- ext/standard/pageinfo.c | 6 +----- ext/standard/syslog.c | 4 +++- 5 files changed, 8 insertions(+), 22 deletions(-) diff --git a/ext/standard/file.h b/ext/standard/file.h index e5c23e6a24..eadd18edb3 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -59,7 +59,7 @@ PHP_FUNCTION(get_meta_tags); PHP_FUNCTION(flock); PHP_FUNCTION(fd_set); PHP_FUNCTION(fd_isset); -#if (!defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS) +#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS) PHP_FUNCTION(realpath); PHP_FUNCTION(fnmatch); #endif diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 70aab7402b..5e31f69a7d 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -464,11 +464,7 @@ PHP_FUNCTION(touch) { pval **filename, **filetime, **fileatime; int ret; -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) - struct stat_libc sb; -#else struct stat sb; -#endif FILE *file; struct utimbuf newtimebuf; struct utimbuf *newtime = NULL; @@ -550,11 +546,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ { zval *stat_dev, *stat_ino, *stat_mode, *stat_nlink, *stat_uid, *stat_gid, *stat_rdev, *stat_size, *stat_atime, *stat_mtime, *stat_ctime, *stat_blksize, *stat_blocks; -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) - struct stat_libc *stat_sb; -#else struct stat *stat_sb; -#endif php_stream_statbuf ssb; int flags = 0, rmask=S_IROTH, wmask=S_IWOTH, xmask=S_IXOTH; /* access rights defaults to other */ char *stat_sb_names[13]={"dev", "ino", "mode", "nlink", "uid", "gid", "rdev", @@ -644,19 +636,19 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ RETURN_LONG((long)ssb.sb.st_gid); case FS_ATIME: #ifdef NETWARE - RETURN_LONG((long)((stat_sb->st_atime).tv_sec)); + RETURN_LONG((long)ssb.sb.st_atime.tv_sec); #else RETURN_LONG((long)ssb.sb.st_atime); #endif case FS_MTIME: #ifdef NETWARE - RETURN_LONG((long)((stat_sb->st_mtime).tv_sec)); + RETURN_LONG((long)ssb.sb.st_mtime.tv_sec); #else RETURN_LONG((long)ssb.sb.st_mtime); #endif case FS_CTIME: #ifdef NETWARE - RETURN_LONG((long)((stat_sb->st_ctime).tv_sec)); + RETURN_LONG((long)ssb.sb.st_ctime.tv_sec); #else RETURN_LONG((long)ssb.sb.st_ctime); #endif diff --git a/ext/standard/link.c b/ext/standard/link.c index 5000a808b5..87b5531ea9 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -89,11 +89,7 @@ PHP_FUNCTION(readlink) PHP_FUNCTION(linkinfo) { zval **filename; -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) - struct stat_libc sb; -#else struct stat sb; -#endif int ret; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index cfa0e94de8..d8783ffe99 100644 --- a/ext/standard/pageinfo.c +++ b/ext/standard/pageinfo.c @@ -59,11 +59,7 @@ */ PHPAPI void php_statpage(TSRMLS_D) { -#if defined(NETWARE) && defined(CLIB_STAT_PATCH) - struct stat_libc *pstat; -#else struct stat *pstat; -#endif pstat = sapi_get_stat(TSRMLS_C); @@ -73,7 +69,7 @@ PHPAPI void php_statpage(TSRMLS_D) BG(page_gid) = pstat->st_gid; BG(page_inode) = pstat->st_ino; #ifdef NETWARE - BG(page_mtime) = (pstat->st_mtime).tv_nsec; + BG(page_mtime) = (pstat->st_mtime).tv_sec; #else BG(page_mtime) = pstat->st_mtime; #endif diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index 9710ea4d60..9af2efee2c 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -75,7 +75,7 @@ PHP_MINIT_FUNCTION(syslog) /* AIX doesn't have LOG_AUTHPRIV */ REGISTER_LONG_CONSTANT("LOG_AUTHPRIV", LOG_AUTHPRIV, CONST_CS | CONST_PERSISTENT); #endif -#if !defined(PHP_WIN32) && !defined(NETWARE) +#ifndef PHP_WIN32 REGISTER_LONG_CONSTANT("LOG_LOCAL0", LOG_LOCAL0, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("LOG_LOCAL1", LOG_LOCAL1, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("LOG_LOCAL2", LOG_LOCAL2, CONST_CS | CONST_PERSISTENT); @@ -144,7 +144,9 @@ static void start_syslog(TSRMLS_D) SET_VAR_LONG("LOG_MAIL", LOG_MAIL); /* log to email */ SET_VAR_LONG("LOG_DAEMON", LOG_DAEMON); /* other system daemons */ SET_VAR_LONG("LOG_AUTH", LOG_AUTH); +#ifndef NETWARE SET_VAR_LONG("LOG_SYSLOG", LOG_SYSLOG); +#endif SET_VAR_LONG("LOG_LPR", LOG_LPR); #ifdef LOG_NEWS /* No LOG_NEWS on HP-UX */ -- 2.50.1