forked from pool/glibc
Andreas Schwab
30e48d0d7f
- Update to glibc 2.21 release. * A new semaphore algorithm has been implemented in generic C code for all machines * Added support for TSX lock elision of pthread mutexes on powerpc32, powerpc64 and powerpc64le * Optimized strcpy, stpcpy, strchrnul and strrchr implementations for AArch64 * i386 memcpy functions optimized with SSE2 unaligned load/store * New locales: tu_IN, bh_IN, raj_IN, ce_RU * The obsolete sigvec function has been removed - Patches from upstream removed * ifunc-x86-slow-sse4.patch * pthread-mutex-trylock-elision.patch - o-tmpfile.patch: Fix value of O_TMPFILE for architectures with non-default O_DIRECTORY (BZ #17912) OBS-URL: https://build.opensuse.org/request/show/285070 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=391
83 lines
2.2 KiB
Diff
83 lines
2.2 KiB
Diff
For details see:
|
|
http://sourceware.org/bugzilla/show_bug.cgi?id=5379
|
|
|
|
|
|
Index: glibc-2.20/sunrpc/clnt_udp.c
|
|
===================================================================
|
|
--- glibc-2.20.orig/sunrpc/clnt_udp.c
|
|
+++ glibc-2.20/sunrpc/clnt_udp.c
|
|
@@ -308,6 +308,7 @@ clntudp_call (cl, proc, xargs, argsp, xr
|
|
XDR *xdrs;
|
|
int outlen = 0;
|
|
int inlen;
|
|
+ int pollresult;
|
|
socklen_t fromlen;
|
|
struct pollfd fd;
|
|
int milliseconds = (cu->cu_wait.tv_sec * 1000) +
|
|
@@ -378,37 +379,39 @@ send_again:
|
|
anyup = 0;
|
|
for (;;)
|
|
{
|
|
- switch (__poll (&fd, 1, milliseconds))
|
|
+ switch (pollresult = __poll (&fd, 1, milliseconds))
|
|
{
|
|
-
|
|
case 0:
|
|
- if (anyup == 0)
|
|
+ case -1:
|
|
+ if (pollresult == 0 || errno == EINTR)
|
|
{
|
|
- anyup = is_network_up (cu->cu_sock);
|
|
- if (!anyup)
|
|
- return (cu->cu_error.re_status = RPC_CANTRECV);
|
|
+ if (anyup == 0)
|
|
+ {
|
|
+ anyup = is_network_up (cu->cu_sock);
|
|
+ if (!anyup)
|
|
+ return (cu->cu_error.re_status = RPC_CANTRECV);
|
|
+ }
|
|
+
|
|
+ time_waited.tv_sec += cu->cu_wait.tv_sec;
|
|
+ time_waited.tv_usec += cu->cu_wait.tv_usec;
|
|
+ while (time_waited.tv_usec >= 1000000)
|
|
+ {
|
|
+ time_waited.tv_sec++;
|
|
+ time_waited.tv_usec -= 1000000;
|
|
+ }
|
|
+ if ((time_waited.tv_sec < timeout.tv_sec) ||
|
|
+ ((time_waited.tv_sec == timeout.tv_sec) &&
|
|
+ (time_waited.tv_usec < timeout.tv_usec)))
|
|
+ {
|
|
+ if (pollresult == 0)
|
|
+ goto send_again;
|
|
+ else
|
|
+ continue;
|
|
+ }
|
|
+ return (cu->cu_error.re_status = RPC_TIMEDOUT);
|
|
}
|
|
|
|
- time_waited.tv_sec += cu->cu_wait.tv_sec;
|
|
- time_waited.tv_usec += cu->cu_wait.tv_usec;
|
|
- while (time_waited.tv_usec >= 1000000)
|
|
- {
|
|
- time_waited.tv_sec++;
|
|
- time_waited.tv_usec -= 1000000;
|
|
- }
|
|
- if ((time_waited.tv_sec < timeout.tv_sec) ||
|
|
- ((time_waited.tv_sec == timeout.tv_sec) &&
|
|
- (time_waited.tv_usec < timeout.tv_usec)))
|
|
- goto send_again;
|
|
- return (cu->cu_error.re_status = RPC_TIMEDOUT);
|
|
-
|
|
- /*
|
|
- * buggy in other cases because time_waited is not being
|
|
- * updated.
|
|
- */
|
|
- case -1:
|
|
- if (errno == EINTR)
|
|
- continue;
|
|
+ /* errno != EINTR */
|
|
cu->cu_error.re_errno = errno;
|
|
return (cu->cu_error.re_status = RPC_CANTRECV);
|
|
}
|