mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
libc vdso time functions: correctly convert errors into errnos
Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
220427da0e
commit
41acfee690
2 changed files with 10 additions and 2 deletions
|
|
@ -48,7 +48,11 @@ __clock_gettime(clockid_t clock_id, struct timespec *ts)
|
|||
error = __vdso_clock_gettime(clock_id, ts);
|
||||
else
|
||||
error = ENOSYS;
|
||||
if (error == ENOSYS)
|
||||
if (error == ENOSYS) {
|
||||
error = __sys_clock_gettime(clock_id, ts);
|
||||
} else if (error != 0) {
|
||||
errno = error;
|
||||
error = -1;
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,11 @@ __gettimeofday(struct timeval *tv, struct timezone *tz)
|
|||
int error;
|
||||
|
||||
error = __vdso_gettimeofday(tv, tz);
|
||||
if (error == ENOSYS)
|
||||
if (error == ENOSYS) {
|
||||
error = __sys_gettimeofday(tv, tz);
|
||||
} else if (error != 0) {
|
||||
errno = error;
|
||||
error = -1;
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue