From: James Moore Date: Sun, 4 Feb 2001 16:18:36 +0000 (+0000) Subject: Always return a value even if HAVE_GETTIMEOFDAY is not set X-Git-Tag: php-4.0.5RC1~372 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=712f09d2a8ea583aa8879727e8e70bc4a5ddb728;p=php Always return a value even if HAVE_GETTIMEOFDAY is not set --- diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index 2fb8a30ec5..ef78fdcffa 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -57,11 +57,13 @@ PHP_FUNCTION(microtime) if (gettimeofday((struct timeval *) &tp, (NUL)) == 0) { msec = (double) (tp.tv_usec / MICRO_IN_SEC); sec = tp.tv_sec; - } - if (msec >= 1.0) msec -= (long) msec; - snprintf(ret, 100, "%.8f %ld", msec, sec); - RETVAL_STRING(ret,1); + + if (msec >= 1.0) msec -= (long) msec; + snprintf(ret, 100, "%.8f %ld", msec, sec); + RETVAL_STRING(ret,1); + } else #endif + RETURN_FALSE; } /* }}} */