Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Unified Diff: remoting/host/linux/linux_me2me_host.py

Issue 2537673002: Update linux_me2me_host.py to exit when Ctrl-C is pressed. (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/linux/linux_me2me_host.py
diff --git a/remoting/host/linux/linux_me2me_host.py b/remoting/host/linux/linux_me2me_host.py
index a40063bf470105b1338d0d97c3d1ba62005d878a..eb4762e54a33aca231aa054f021bed076c54487d 100755
--- a/remoting/host/linux/linux_me2me_host.py
+++ b/remoting/host/linux/linux_me2me_host.py
@@ -862,11 +862,11 @@ class ParentProcessLogger(object):
false otherwise.
"""
# If Ctrl-C is pressed, inform the user that the daemon is still running.
- # This signal will cause the read loop below to stop with an EINTR IOError.
def sigint_handler(signum, frame):
_ = signum, frame
print("Interrupted. The daemon is still running in the background.",
file=sys.stderr)
+ sys.exit(1)
signal.signal(signal.SIGINT, sigint_handler)
@@ -889,17 +889,13 @@ class ParentProcessLogger(object):
# Print lines as they're logged to the pipe until EOF is reached or readline
# is interrupted by one of the signal handlers above.
host_ready = False
- try:
- for line in iter(self._read_file.readline, ''):
- if line[:4] == "MSG:":
- sys.stderr.write(line[4:])
- elif line == "READY\n":
- host_ready = True
- else:
- sys.stderr.write("Unrecognized command: " + line)
- except IOError as e:
- if e.errno != errno.EINTR:
- raise
+ for line in iter(self._read_file.readline, ''):
+ if line[:4] == "MSG:":
+ sys.stderr.write(line[4:])
+ elif line == "READY\n":
+ host_ready = True
+ else:
+ sys.stderr.write("Unrecognized command: " + line)
print("Log file: %s" % os.environ[LOG_FILE_ENV_VAR], file=sys.stderr)
return host_ready
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698