Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/librumphijack Ignore the contents of revents when poll()...



details:   https://anonhg.NetBSD.org/src/rev/72a09520f20d
branches:  trunk
changeset: 330788:72a09520f20d
user:      gson <gson%NetBSD.org@localhost>
date:      Mon Jul 21 14:23:43 2014 +0000

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

diffstat:

 lib/librumphijack/hijack.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (33 lines):

diff -r 032f1462cd8a -r 72a09520f20d lib/librumphijack/hijack.c
--- a/lib/librumphijack/hijack.c        Mon Jul 21 12:03:38 2014 +0000
+++ b/lib/librumphijack/hijack.c        Mon Jul 21 14:23:43 2014 +0000
@@ -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 @@
                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--;
                }
 



Home | Main Index | Thread Index | Old Index