]> granicus.if.org Git - php/commitdiff
Always return a value even if HAVE_GETTIMEOFDAY is not set
authorJames Moore <jmoore@php.net>
Sun, 4 Feb 2001 16:18:36 +0000 (16:18 +0000)
committerJames Moore <jmoore@php.net>
Sun, 4 Feb 2001 16:18:36 +0000 (16:18 +0000)
ext/standard/microtime.c

index 2fb8a30ec534c9bca66c3dfad4215e73785366bd..ef78fdcffafbb64bfa0296737b483a684260c75d 100644 (file)
@@ -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;
 }
 /* }}} */