mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-05 09:01:07 +00:00
Round milli seconds to nearest. Don't return 1000 in millitm.
This commit is contained in:
parent
078405a203
commit
1396cb052d
@ -30,7 +30,12 @@ ftime (timebuf)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
timebuf->time = tv.tv_sec;
|
timebuf->time = tv.tv_sec;
|
||||||
timebuf->millitm = (tv.tv_usec + 999) / 1000;
|
timebuf->millitm = (tv.tv_usec + 500) / 1000;
|
||||||
|
if (timebuf->millitm == 1000)
|
||||||
|
{
|
||||||
|
++timebuf->time;
|
||||||
|
timebuf->millitm = 0;
|
||||||
|
}
|
||||||
timebuf->timezone = tz.tz_minuteswest;
|
timebuf->timezone = tz.tz_minuteswest;
|
||||||
timebuf->dstflag = tz.tz_dsttime;
|
timebuf->dstflag = tz.tz_dsttime;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user