mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Set errno in adjtime if delta is too large
errno should be set to EINVAL in this case according to adjtime's man page.
This commit is contained in:
parent
f2c8de6b1b
commit
aa496e6550
@ -123,6 +123,7 @@ int adjtime(const struct timeval *delta, struct timeval *outdelta)
|
|||||||
int64_t sec = delta->tv_sec;
|
int64_t sec = delta->tv_sec;
|
||||||
int64_t usec = delta->tv_usec;
|
int64_t usec = delta->tv_usec;
|
||||||
if(llabs(sec) > ((INT_MAX / 1000000L) - 1L)) {
|
if(llabs(sec) > ((INT_MAX / 1000000L) - 1L)) {
|
||||||
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user