mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Fix an error in clock_timespec_subtract
This commit is contained in:
@@ -83,7 +83,7 @@ void clock_timespec_subtract(FAR const struct timespec *ts1,
|
||||
}
|
||||
else
|
||||
{
|
||||
sec = ts1->tv_sec + ts2->tv_sec;
|
||||
sec = ts1->tv_sec - ts2->tv_sec;
|
||||
if (ts1->tv_nsec < ts2->tv_nsec)
|
||||
{
|
||||
nsec = (ts1->tv_nsec + NSEC_PER_SEC) - ts2->tv_nsec;
|
||||
|
||||
Reference in New Issue
Block a user