From ef670d888558ee33794442d9f7e8c1759ae2c3ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Mon, 8 Jun 2015 20:17:18 +0200 Subject: [PATCH] Retry select() on EINTR --- src/frida/application.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/frida/application.py b/src/frida/application.py index 5dafd36..c4b7a2b 100755 --- a/src/frida/application.py +++ b/src/frida/application.py @@ -1,13 +1,14 @@ # -*- coding: utf-8 -*- import collections +import errno from optparse import OptionParser import os import platform +import select import sys import threading import time -from select import select import colorama from colorama import Style @@ -33,7 +34,13 @@ def input_with_timeout(timeout): return s else: - rlist, _, _ = select([sys.stdin], [], [], timeout) + while True: + try: + rlist, _, _ = select.select([sys.stdin], [], [], timeout) + break + except (OSError, select.error) as e: + if e.args[0] != errno.EINTR: + raise e if rlist: return sys.stdin.readline() else: