[Patch] Fix ETIME handling for Solaris event ports hopefully with non scrubbed patch
Nathan Huff
nhuff at acm.org
Tue Feb 2 18:18:24 UTC 2016
Let's see if I can get the mailing list software to not scrub the patch.
-------------- next part --------------
diff --git a/lib/tevent/tevent_port.c b/lib/tevent/tevent_port.c
index 5b487d7..4b06e0e 100644
--- a/lib/tevent/tevent_port.c
+++ b/lib/tevent/tevent_port.c
@@ -484,29 +484,29 @@ static int port_event_loop(struct port_event_context *port_ev, struct timeval *t
port_errno = errno;
tevent_trace_point_callback(ev, TEVENT_TRACE_AFTER_WAIT);
- if (ret == -1 && port_errno == EINTR) {
- if (ev->signal_events) {
- tevent_common_check_signal(ev);
- }
- /*
- * If no signal handlers we got an unsolicited
- * signal wakeup. This can happen with epoll
- * too. Just return and ignore.
- */
- return 0;
- }
-
- if (ret == -1 && port_errno == ETIME && tvalp) {
- /* we don't care about a possible delay here */
- tevent_common_loop_timer_delay(ev);
- return 0;
- }
-
if (ret == -1) {
- tevent_debug(ev, TEVENT_DEBUG_ERROR,
- "port_get failed (%s)\n",
- strerror(errno));
- return -1;
+ if (port_errno == EINTR) {
+ if (ev->signal_events) {
+ tevent_common_check_signal(ev);
+ }
+ /*
+ * If no signal handlers we got an unsolicited
+ * signal wakeup. This can happen with epoll
+ * too. Just return and ignore.
+ */
+ return 0;
+ } else if (port_errno == ETIME) {
+ if ( nget == 0 && tvalp ) {
+ /* we don't care about a possible delay here */
+ tevent_common_loop_timer_delay(ev);
+ return 0;
+ }
+ } else {
+ tevent_debug(ev, TEVENT_DEBUG_ERROR,
+ "port_get failed (%s)\n",
+ strerror(errno));
+ return -1;
+ }
}
for (i = 0; i < nget; i++) {
More information about the samba-technical
mailing list