diff options
author | James Moore <jmoore@php.net> | 2001-02-04 16:18:36 +0000 |
---|---|---|
committer | James Moore <jmoore@php.net> | 2001-02-04 16:18:36 +0000 |
commit | 712f09d2a8ea583aa8879727e8e70bc4a5ddb728 (patch) | |
tree | ad794f25859dca411ea9f7f82cdb259510e75360 /ext/standard/microtime.c | |
parent | a97e0e196471980f04536d1a0fe26ae81bbcffc4 (diff) | |
download | php-git-712f09d2a8ea583aa8879727e8e70bc4a5ddb728.tar.gz |
Always return a value even if HAVE_GETTIMEOFDAY is not set
Diffstat (limited to 'ext/standard/microtime.c')
-rw-r--r-- | ext/standard/microtime.c | 10 |
1 files changed, 6 insertions, 4 deletions
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; } /* }}} */ |