revise Filip's patch so that it more closely mimics the select() path

This commit is contained in:
Nalin Dahyabhai 2012-09-10 18:47:48 -04:00
parent a4ad97ae22
commit 3e1f3982d4
2 changed files with 18 additions and 15 deletions

View File

@ -1,14 +1,17 @@
Filip Krska's patch to abort the current pass after poll() returns when
we've given it an indefinite timeout.
When wrapping poll(), if we compute a negative timeout, just return a
no-results status, as the krb5int_cm_call_select() wrapper for select()
does. Based on a patch by Filip Krska.
--- krb5/src/lib/krb5/os/sendto_kdc.c
+++ krb5/src/lib/krb5/os/sendto_kdc.c
@@ -529,6 +529,8 @@ cm_select_or_poll(const struct select_st
*out = *in;
*sret = poll(out->fds, out->nfds, timeout);
e = SOCKET_ERRNO;
+ if (timeout < 0)
+ return e;
return (*sret < 0) ? e : 0;
#else
/* Use the select wrapper from cm.c. */
@@ -523,6 +523,10 @@ cm_select_or_poll(const struct select_st
return e;
timeout = (in->end_time.tv_sec - now.tv_sec) * 1000 +
(in->end_time.tv_usec - now.tv_usec) / 1000;
+ if (timeout < 0) {
+ *sret = 0;
+ return 0;
+ }
}
/* We don't need a separate copy of the selstate for poll, but use one
* anyone for consistency with the select wrapper. */

View File

@ -852,11 +852,11 @@ exit 0
%{_sbindir}/uuserver
%changelog
* Fri Sep 6 2012 Nalin Dahyabhai <nalin@redhat.com> 1.10.3-5
- add patch from Filip Krska to abort a transmit attempt when we've given
poll() a negative timeout (#838548)
* Mon Sep 10 2012 Nalin Dahyabhai <nalin@redhat.com> 1.10.3-5
- add patch based on one from Filip Krska to not call poll() with a negative
timeout when the caller's intent is for us to just stop calling it (#838548)
* Fri Sep 6 2012 Nalin Dahyabhai <nalin@redhat.com>
* Fri Sep 7 2012 Nalin Dahyabhai <nalin@redhat.com>
- on EL6, conflict with libsmbclient before 3.5.10-124, which is when it
stopped linking with a symbol which we no longer export (#771687)
- pull up patch for RT#7063, in which not noticing a prompt for a long