about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-04-08 07:39:32 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-04-12 18:38:37 -0300
commitcedbf6d5f3f70ca911176de87d6e453eeab4b7a1 (patch)
treeda19070ed554fc60b8d9f8085f675d68953dc45e /sysdeps
parent9d7c5cc38e58fb0923e88901f87174a511b61552 (diff)
downloadglibc-cedbf6d5f3f70ca911176de87d6e453eeab4b7a1.tar.gz
glibc-cedbf6d5f3f70ca911176de87d6e453eeab4b7a1.tar.xz
glibc-cedbf6d5f3f70ca911176de87d6e453eeab4b7a1.zip
linux: always update select timeout (BZ #27706)
The timeout should be updated even on failure for time64 support.

Checked on i686-linux-gnu.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/select.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/select.c b/sysdeps/unix/sysv/linux/select.c
index 3b67ff4476..dc16a816ed 100644
--- a/sysdeps/unix/sysv/linux/select.c
+++ b/sysdeps/unix/sysv/linux/select.c
@@ -107,7 +107,7 @@ __select64 (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
   r = SYSCALL_CANCEL (pselect6, nfds, readfds, writefds, exceptfds, pts32,
 		      NULL);
 # endif
-  if (r >= 0 && timeout != NULL)
+  if (timeout != NULL)
     *timeout = valid_timespec_to_timeval64 (ts32);
 #endif
 
@@ -128,7 +128,7 @@ __select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
       ptv64 = &tv64;
     }
   int r = __select64 (nfds, readfds, writefds, exceptfds, ptv64);
-  if (r >= 0 && timeout != NULL)
+  if (timeout != NULL)
     /* The remanining timeout will be always less the input TIMEOUT.  */
     *timeout = valid_timeval64_to_timeval (tv64);
   return r;