Skip to content

Commit f58a589

Browse files
committed
Fix add_timespec in other codes besides red_test
1 parent 1817b8b commit f58a589

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/linux/ebox/ebox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void add_timespec(struct timespec *ts, int64 addtime)
250250
sec = (addtime - nsec) / NSEC_PER_SEC;
251251
ts->tv_sec += sec;
252252
ts->tv_nsec += nsec;
253-
if ( ts->tv_nsec > NSEC_PER_SEC )
253+
if ( ts->tv_nsec >= NSEC_PER_SEC )
254254
{
255255
nsec = ts->tv_nsec % NSEC_PER_SEC;
256256
ts->tv_sec += (ts->tv_nsec - nsec) / NSEC_PER_SEC;

test/win32/ebox/ebox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void add_timespec(struct timespec *ts, int64 addtime)
250250
sec = (addtime - nsec) / NSEC_PER_SEC;
251251
ts->tv_sec += sec;
252252
ts->tv_nsec += nsec;
253-
if ( ts->tv_nsec > NSEC_PER_SEC )
253+
if ( ts->tv_nsec >= NSEC_PER_SEC )
254254
{
255255
nsec = ts->tv_nsec % NSEC_PER_SEC;
256256
ts->tv_sec += (ts->tv_nsec - nsec) / NSEC_PER_SEC;

0 commit comments

Comments
 (0)