Skip to content

Commit

Permalink
Merge branch 'contrib/github_pr_10334_v4.4' into 'release/v4.4'
Browse files Browse the repository at this point in the history
Set errno in adjtime (GitHub PR) (v4.4)

See merge request espressif/esp-idf!22599
  • Loading branch information
suda-morris committed Mar 5, 2023
2 parents 4227dcc + 6802299 commit a6473f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/newlib/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
/*
Expand All @@ -153,6 +154,7 @@ int adjtime(const struct timeval *delta, struct timeval *outdelta)
}
return 0;
#else
errno = ENOSYS;
return -1;
#endif
}
Expand Down

0 comments on commit a6473f1

Please sign in to comment.