blob: 138dc7467f5c4693c8e4166373d17fff7c1a69e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
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
@@ -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. */
|