]> git.feebdaed.xyz Git - 0xmirror/SOEM.git/commitdiff
Fix `add_timespec` in other codes besides `red_test` (#794)
authorWindsgo <18221102427@163.com>
Thu, 21 Mar 2024 06:51:29 +0000 (14:51 +0800)
committerGitHub <noreply@github.com>
Thu, 21 Mar 2024 06:51:29 +0000 (07:51 +0100)
test/linux/ebox/ebox.c
test/win32/ebox/ebox.c

index 68e0e6a8058e1a44ccaff7964bba20fcc4d3b000..262873466529ba801460dda326cd104652926f85 100644 (file)
@@ -250,7 +250,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;
index 7d232bf799f0449c09314ad0ce9c306adca306f3..cd1fb422a76e6993a8d4922087f05048e5d7c1ba 100644 (file)
@@ -250,7 +250,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;