diff options
| author | Yonggang Luo <[email protected]> | 2025-09-27 17:47:30 +0800 |
|---|---|---|
| committer | R b b666 <[email protected]> | 2025-10-13 21:44:01 +0800 |
| commit | 517e5b132b5d4221f08e6facc8c5397199219b73 (patch) | |
| tree | d326d9d03a0f6d0cea692489bca62dba0e88656d /components/libc | |
| parent | a3cc23396910c41b83c60127cae8afec78d1dfb5 (diff) | |
compute ns with rt_int64_t instead of int64_t in ctime.c
Diffstat (limited to 'components/libc')
| -rw-r--r-- | components/libc/compilers/common/ctime.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/libc/compilers/common/ctime.c b/components/libc/compilers/common/ctime.c index 7910356704..159667bbcf 100644 --- a/components/libc/compilers/common/ctime.c +++ b/components/libc/compilers/common/ctime.c @@ -700,7 +700,7 @@ int clock_nanosleep(clockid_t clockid, int flags, const struct timespec *rqtp, s if (err != RT_EOK) return err; - int64_t ns = rqtp->tv_nsec - ts.tv_nsec + (rqtp->tv_sec - ts.tv_sec) * NANOSECOND_PER_SECOND; + rt_int64_t ns = rqtp->tv_nsec - ts.tv_nsec + (rt_int64_t)(rqtp->tv_sec - ts.tv_sec) * NANOSECOND_PER_SECOND; if (ns <= 0) return 0; @@ -1222,7 +1222,7 @@ int timer_settime(timer_t timerid, int flags, const struct itimerspec *value, if (err != RT_EOK) return err; - int64_t ns = value->it_value.tv_nsec - ts.tv_nsec + (value->it_value.tv_sec - ts.tv_sec) * NANOSECOND_PER_SECOND; + rt_int64_t ns = value->it_value.tv_nsec - ts.tv_nsec + (rt_int64_t)(value->it_value.tv_sec - ts.tv_sec) * NANOSECOND_PER_SECOND; if (ns <= 0) return 0; |
