diff --git a/arch/sim/src/sim/sim_oneshot.c b/arch/sim/src/sim/sim_oneshot.c index 636dff052b5d2..757df190cefcc 100644 --- a/arch/sim/src/sim/sim_oneshot.c +++ b/arch/sim/src/sim/sim_oneshot.c @@ -132,7 +132,7 @@ static inline void sim_timer_current(struct timespec *ts) static inline void sim_reset_alarm(struct timespec *alarm) { - alarm->tv_sec = UINT_MAX; + alarm->tv_sec = INT_MAX; alarm->tv_nsec = NSEC_PER_SEC - 1; } @@ -281,7 +281,7 @@ static int sim_max_delay(struct oneshot_lowerhalf_s *lower, { DEBUGASSERT(ts != NULL); - ts->tv_sec = UINT_MAX; + ts->tv_sec = INT_MAX; ts->tv_nsec = NSEC_PER_SEC - 1; return OK; } diff --git a/include/sys/types.h b/include/sys/types.h index 557ed051cfaa3..32328ac30f032 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -251,10 +251,10 @@ typedef uint16_t sa_family_t; #ifdef CONFIG_SYSTEM_TIME64 typedef uint64_t clock_t; -typedef uint64_t time_t; /* Holds time in seconds */ +typedef int64_t time_t; /* Holds time in seconds */ #else typedef uint32_t clock_t; -typedef uint32_t time_t; /* Holds time in seconds */ +typedef int32_t time_t; /* Holds time in seconds */ #endif typedef int clockid_t; /* Identifies one time base source */ typedef FAR void *timer_t; /* Represents one POSIX timer */