Update red_test.c
This commit is contained in:
parent
4b4cdc2c45
commit
2c1b9b2756
@ -142,7 +142,7 @@ void add_timespec(struct timespec *ts, int64 addtime)
|
||||
sec = (addtime - nsec) / NSEC_PER_SEC;
|
||||
ts->tv_sec += sec;
|
||||
ts->tv_nsec += nsec;
|
||||
if ( ts->tv_nsec > NSEC_PER_SEC )
|
||||
if ( ts->tv_nsec >= NSEC_PER_SEC )
|
||||
{
|
||||
nsec = ts->tv_nsec % NSEC_PER_SEC;
|
||||
ts->tv_sec += (ts->tv_nsec - nsec) / NSEC_PER_SEC;
|
||||
|
Loading…
x
Reference in New Issue
Block a user