Commit a3d74c0f authored by alina's avatar alina

Igonring interrupted system call in _read_reply

parent 6d20dfda
...@@ -100,12 +100,8 @@ class Server(object): ...@@ -100,12 +100,8 @@ class Server(object):
while time.time() - now < KILL_WAIT: while time.time() - now < KILL_WAIT:
ch = [] ch = []
for pid in self._children: for pid in self._children:
try: if not netns.subprocess_.poll(pid):
if not netns.subprocess_.poll(pid): ch.append(pid)
ch.append(pid)
except OSError, e:
if e.errno != errno.ECHILD:
raise e
if not ch: if not ch:
break break
time.sleep(0.1) time.sleep(0.1)
...@@ -113,11 +109,7 @@ class Server(object): ...@@ -113,11 +109,7 @@ class Server(object):
warning("Killing forcefully process %d." % pid) warning("Killing forcefully process %d." % pid)
os.kill(pid, signal.SIGKILL) os.kill(pid, signal.SIGKILL)
for pid in ch: for pid in ch:
try: netns.subprocess_.poll(pid)
netns.subprocess_.poll(pid)
except OSError, e:
if e.errno != errno.ECHILD:
raise e
for f in self._xauthfiles.values(): for f in self._xauthfiles.values():
try: try:
...@@ -545,7 +537,13 @@ class Client(object): ...@@ -545,7 +537,13 @@ class Client(object):
raise RuntimeError("Client already shut down.") raise RuntimeError("Client already shut down.")
text = [] text = []
while True: while True:
line = self._rfd.readline().rstrip() try:
line = self._rfd.readline().rstrip()
except IOError, e:
if e.errno == errno.EINTR:
continue
else:
raise e
if not line: if not line:
raise RuntimeError("Protocol error, empty line received") raise RuntimeError("Protocol error, empty line received")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment