From: Anantha Kesari H Y Date: Wed, 27 Jul 2005 11:22:36 +0000 (+0000) Subject: ext/standard/datetime.c X-Git-Tag: php-4.4.1RC1~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=646da25288ae62a0d6552dc5ca32e88ecb9ba570;p=php ext/standard/datetime.c Removed redundant NEW_LIBC checks ext/standard/head.c Removed redundant inclusion of headers ext/standard/image.c Removed redundant inclusion of headers ext/standard/pageinfo.c Removed redundant CLIB_STAT_CHECK. BG(page_mtime) was giving nano seconds portion out of timespec corrected to seconds. ext/standard/math.c Not to hardcode inability as much as possible, in future NetWare LibC SDK might have asinh that time autoconf can make this function available. ext/standard/filestat.c Fixed the typo of accessing the nano seconds from a timer_spec to seconds. --Kamesh --- diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index f5736ca556..a8359024f4 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -52,7 +52,7 @@ char *day_short_names[] = { }; #if !defined(HAVE_TM_ZONE) && !defined(_TIMEZONE) && !defined(HAVE_DECLARED_TIMEZONE) -#if defined(NETWARE) && defined(NEW_LIBC) +#ifdef NETWARE #define timezone _timezone /* timezone is called '_timezone' in new version of LibC */ #endif extern time_t timezone; diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 6a11053de7..e5e4b696c6 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -678,19 +678,19 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ RETURN_LONG((long)BG(sb).st_gid); case FS_ATIME: #ifdef NETWARE - RETURN_LONG((long)(BG(sb).st_atime).tv_nsec); + RETURN_LONG((long)(BG(sb).st_atime).tv_sec); #else RETURN_LONG((long)BG(sb).st_atime); #endif case FS_MTIME: #ifdef NETWARE - RETURN_LONG((long)(BG(sb).st_mtime).tv_nsec); + RETURN_LONG((long)(BG(sb).st_mtime).tv_sec); #else RETURN_LONG((long)BG(sb).st_mtime); #endif case FS_CTIME: #ifdef NETWARE - RETURN_LONG((long)(BG(sb).st_ctime).tv_nsec); + RETURN_LONG((long)(BG(sb).st_ctime).tv_sec); #else RETURN_LONG((long)BG(sb).st_ctime); #endif @@ -769,9 +769,9 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ #endif MAKE_LONG_ZVAL_INCREF(stat_size, stat_sb->st_size); #ifdef NETWARE - MAKE_LONG_ZVAL_INCREF(stat_atime, (stat_sb->st_atime).tv_nsec); - MAKE_LONG_ZVAL_INCREF(stat_mtime, (stat_sb->st_mtime).tv_nsec); - MAKE_LONG_ZVAL_INCREF(stat_ctime, (stat_sb->st_ctime).tv_nsec); + MAKE_LONG_ZVAL_INCREF(stat_atime, (stat_sb->st_atime).tv_sec); + MAKE_LONG_ZVAL_INCREF(stat_mtime, (stat_sb->st_mtime).tv_sec); + MAKE_LONG_ZVAL_INCREF(stat_ctime, (stat_sb->st_ctime).tv_sec); #else MAKE_LONG_ZVAL_INCREF(stat_atime, stat_sb->st_atime); MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_sb->st_mtime); diff --git a/ext/standard/head.c b/ext/standard/head.c index 3abf3f4405..0a45191496 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -18,11 +18,6 @@ /* $Id$ */ #include - -#if defined(NETWARE) && !defined(NEW_LIBC) -#include -#endif - #include "php.h" #include "ext/standard/php_standard.h" #include "SAPI.h" diff --git a/ext/standard/image.c b/ext/standard/image.c index 4849fff715..fbfe5ab5bf 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -21,9 +21,6 @@ #include "php.h" #include -#if defined(NETWARE) && !defined(NEW_LIBC) -#include -#endif #if HAVE_FCNTL_H #include #endif diff --git a/ext/standard/math.c b/ext/standard/math.c index 320518ad37..e29b5f48fc 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -329,7 +329,7 @@ PHP_FUNCTION(tanh) /* }}} */ -#if !defined(PHP_WIN32) && !defined(NETWARE) +#ifndef PHP_WIN32 #ifdef HAVE_ASINH /* {{{ proto float asinh(float number) Returns the inverse hyperbolic sine of the number, i.e. the value whose hyperbolic sine is number */ @@ -380,7 +380,7 @@ PHP_FUNCTION(atanh) } /* }}} */ #endif /* HAVE_ATANH */ -#endif /* !defined(PHP_WIN32) && !defined(NETWARE) */ +#endif /* ifndf PHP_WIN32 */ /* {{{ proto float pi(void) diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index 7c83323741..3c91a14c77 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