Permalink
Browse files

Merge pull request #847 from yousong/poll-eintr

cli: ignore EINTR caused by SIGWINCH when calling poll()
  • Loading branch information...
lantz committed Dec 20, 2018
2 parents fd96de6 + f170cc6 commit cf6da391fa4a9271071dff59b41c9fe4e74277dd
Showing with 9 additions and 0 deletions.
  1. +9 −0 mininet/cli.py
@@ -29,6 +29,8 @@
from cmd import Cmd
from os import isatty
from select import poll, POLLIN
import select
import errno
import sys
import time
import os
@@ -459,6 +461,13 @@ def waitForNode( self, node ):
# it's possible to interrupt ourselves after we've
# read data but before it has been printed.
node.sendInt()
except select.error as e:
# pylint: disable=unpacking-non-sequence
errno_, errmsg = e.args
# pylint: enable=unpacking-non-sequence
if errno_ != errno.EINTR:
error( "select.error: %d, %s" % (errno_, errmsg) )
node.sendInt()

def precmd( self, line ):
"allow for comments in the cli"

0 comments on commit cf6da39

Please sign in to comment.