Module Name:    src
Committed By:   gson
Date:           Mon Jul 21 14:23:43 UTC 2014

Modified Files:
        src/lib/librumphijack: hijack.c

Log Message:
Ignore the contents of revents when poll() returns failure.
This is one more part to the fix for PR kern/46464.  Patch
from pooka.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/lib/librumphijack/hijack.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.108 src/lib/librumphijack/hijack.c:1.109
--- src/lib/librumphijack/hijack.c:1.108	Sat Jul 19 14:14:21 2014
+++ src/lib/librumphijack/hijack.c	Mon Jul 21 14:23:43 2014
@@ -1,4 +1,4 @@
-/*      $NetBSD: hijack.c,v 1.108 2014/07/19 14:14:21 gson Exp $	*/
+/*      $NetBSD: hijack.c,v 1.109 2014/07/21 14:23:43 gson Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
 #include <rump/rumpuser_port.h>
 
 #if !defined(lint)
-__RCSID("$NetBSD: hijack.c,v 1.108 2014/07/19 14:14:21 gson Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.109 2014/07/21 14:23:43 gson Exp $");
 #endif
 
 #include <sys/param.h>
@@ -2069,12 +2069,10 @@ REALPOLLTS(struct pollfd *fds, nfds_t nf
 		errno_host = parg.errnum;
 
 		/* strip cross-thread notification from real results */
-		if (pfd_host[nfds].revents & POLLIN) {
-			assert(rv_host > 0);
+		if (rv_host > 0 && pfd_host[nfds].revents & POLLIN) {
 			rv_host--;
 		}
-		if (pfd_rump[nfds].revents & POLLIN) {
-			assert(rv_rump > 0);
+		if (rv_rump > 0 && pfd_rump[nfds].revents & POLLIN) {
 			rv_rump--;
 		}
 

Reply via email to