1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

hurd: Use __clock_gettime in _hurd_select

The __gettimeofday references caused check-localplt failures after
commit 5e46749c64.

Fixes: 5e46749c64
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Change-Id: Ia6da4045157a5bbccc67d79e881d7592e6f8a890
This commit is contained in:
Florian Weimer
2019-11-07 09:52:11 +01:00
parent 50471a8613
commit a673c07af3

View File

@ -88,7 +88,7 @@ _hurd_select (int nfds,
reply_msgid = IO_SELECT_REPLY_MSGID; reply_msgid = IO_SELECT_REPLY_MSGID;
else else
{ {
struct timeval now; struct timespec now;
if (timeout->tv_sec < 0 || ! valid_nanoseconds (timeout->tv_nsec)) if (timeout->tv_sec < 0 || ! valid_nanoseconds (timeout->tv_nsec))
{ {
@ -96,12 +96,12 @@ _hurd_select (int nfds,
return -1; return -1;
} }
err = __gettimeofday(&now, NULL); err = __clock_gettime (CLOCK_REALTIME, &now);
if (err) if (err)
return -1; return -1;
ts.tv_sec = now.tv_sec + timeout->tv_sec; ts.tv_sec = now.tv_sec + timeout->tv_sec;
ts.tv_nsec = now.tv_usec * 1000 + timeout->tv_nsec; ts.tv_nsec = now.tv_nsec + timeout->tv_nsec;
if (ts.tv_nsec >= 1000000000) if (ts.tv_nsec >= 1000000000)
{ {
@ -175,8 +175,7 @@ _hurd_select (int nfds,
if (error) if (error)
{ {
/* Set timeout to 0. */ /* Set timeout to 0. */
struct timeval now; err = __clock_gettime (CLOCK_REALTIME, &ts);
err = __gettimeofday(&now, NULL);
if (err) if (err)
{ {
/* Really bad luck. */ /* Really bad luck. */
@ -192,8 +191,6 @@ _hurd_select (int nfds,
errno = err; errno = err;
return -1; return -1;
} }
ts.tv_sec = now.tv_sec;
ts.tv_nsec = now.tv_usec * 1000;
reply_msgid = IO_SELECT_TIMEOUT_REPLY_MSGID; reply_msgid = IO_SELECT_TIMEOUT_REPLY_MSGID;
} }