Browse Source

Always return a value even if HAVE_GETTIMEOFDAY is not set

PHP-4.0.5
James Moore 25 years ago
parent
commit
712f09d2a8
  1. 10
      ext/standard/microtime.c

10
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;
}
/* }}} */

Loading…
Cancel
Save