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
@ -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 New Issue
Block a user