Skip to content

Commit

Permalink
Merge branch 'contrib/github_pr_10334' into 'master'
Browse files Browse the repository at this point in the history
Set errno in adjtime (GitHub PR)

Closes IDFGH-8915

See merge request espressif/esp-idf!21516
  • Loading branch information
igrr committed Dec 13, 2022
2 parents 3b31370 + 60767c2 commit ff23012
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/newlib/time.c
Expand Up @@ -123,6 +123,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;
}
/*
Expand All @@ -139,6 +140,7 @@ int adjtime(const struct timeval *delta, struct timeval *outdelta)
}
return 0;
#else
errno = ENOSYS;
return -1;
#endif
}
Expand Down

0 comments on commit ff23012

Please sign in to comment.