diff --git a/components/newlib/time.c b/components/newlib/time.c index a021d15eee..4a0bfb01da 100644 --- a/components/newlib/time.c +++ b/components/newlib/time.c @@ -137,6 +137,7 @@ int adjtime(const struct timeval *delta, struct timeval *outdelta) int64_t sec = delta->tv_sec; int64_t usec = delta->tv_usec; if(llabs(sec) > ((INT_MAX / 1000000L) - 1L)) { + errno = EINVAL; return -1; } /* @@ -153,6 +154,7 @@ int adjtime(const struct timeval *delta, struct timeval *outdelta) } return 0; #else + errno = ENOSYS; return -1; #endif }