am 2be3f09f: Merge "time: Improve C99 compliance"
* commit '2be3f09f2d9b6d35b262f7a6148f51c164bb8cbb': time: Improve C99 compliance
This commit is contained in:
commit
c643a4d4c7
@ -34,12 +34,15 @@ time_t
|
||||
time(time_t *t)
|
||||
{
|
||||
struct timeval tt;
|
||||
time_t ret;
|
||||
|
||||
if (gettimeofday(&tt, (struct timezone *)0) < 0)
|
||||
return (-1);
|
||||
if (t)
|
||||
*t = (time_t)tt.tv_sec;
|
||||
return (tt.tv_sec);
|
||||
ret = -1;
|
||||
else
|
||||
ret = tt.tv_sec;
|
||||
if (t != NULL)
|
||||
*t = ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
// return monotonically increasing CPU time in ticks relative to unspecified epoch
|
||||
|
Loading…
x
Reference in New Issue
Block a user