mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
Merge branch 'contrib/github_pr_10334_v4.4' into 'release/v4.4'
Set errno in adjtime (GitHub PR) (v4.4) See merge request espressif/esp-idf!22599
This commit is contained in:
@ -137,6 +137,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;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -153,6 +154,7 @@ int adjtime(const struct timeval *delta, struct timeval *outdelta)
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
errno = ENOSYS;
|
||||||
return -1;
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user