From d5b4aa829b1ec92c57f60d1eec01e4d42bd279d4 Mon Sep 17 00:00:00 2001 From: "julian.filter" Date: Thu, 9 Apr 2020 17:10:52 +0200 Subject: [PATCH] Improve util.pmonitor --- mininet/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mininet/util.py b/mininet/util.py index 3f6c31c..d724096 100644 --- a/mininet/util.py +++ b/mininet/util.py @@ -451,7 +451,7 @@ def pmonitor(popens, timeoutms=500, readline=True, fd = popen.stdout.fileno() fdToHost[ fd ] = host fdToDecoder[ fd ] = getincrementaldecoder() - poller.register( fd, POLLIN | POLLHUP ) + poller.register( fd, POLLIN ) flags = fcntl( fd, F_GETFL ) fcntl( fd, F_SETFL, flags | O_NONBLOCK ) while popens: @@ -461,7 +461,7 @@ def pmonitor(popens, timeoutms=500, readline=True, host = fdToHost[ fd ] decoder = fdToDecoder[ fd ] popen = popens[ host ] - if event & POLLIN or event & POLLHUP: + if event & ( POLLIN | POLLHUP ): while True: try: f = popen.stdout