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

Unified Diff: build/android/adb_logcat_monitor.py

Issue 25679007: Add a new script forked_adb_logcat_monitor.py. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months 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
Index: build/android/adb_logcat_monitor.py
diff --git a/build/android/adb_logcat_monitor.py b/build/android/adb_logcat_monitor.py
index 0464b5303c1e04a422785260faf77553dd77fa9f..c69463ca0ad2f92f9535275caa351bb5e56e6e66 100755
--- a/build/android/adb_logcat_monitor.py
+++ b/build/android/adb_logcat_monitor.py
@@ -94,17 +94,8 @@ def GetAttachedDevices(adb_cmd):
signal.alarm(0)
-def main(base_dir, adb_cmd='adb'):
+def SpawnLogcatWatchers(base_dir, adb_cmd='adb'):
"""Monitor adb forever. Expects a SIGINT (Ctrl-C) to kill."""
- # Spawn a detached child process.
- pid = os.fork()
- if pid > 0:
- os._exit(os.EX_OK)
- elif pid < 0:
- sys.exit('Unable to spawn a detached child process.')
- os.setsid()
- # The rest happens in the child process.
-
# We create the directory to ensure 'run once' semantics
if os.path.exists(base_dir):
print 'adb_logcat_monitor: %s already exists? Cleaning' % base_dir
@@ -160,6 +151,6 @@ def main(base_dir, adb_cmd='adb'):
if __name__ == '__main__':
if 2 <= len(sys.argv) <= 3:
print 'adb_logcat_monitor: Initializing'
- sys.exit(main(*sys.argv[1:3]))
+ sys.exit(SpawnLogcatWatchers(*sys.argv[1:3]))
print 'Usage: %s <base_dir> [<adb_binary_path>]' % sys.argv[0]
« no previous file with comments | « no previous file | build/android/buildbot/bb_device_steps.py » ('j') | build/android/forked_adb_logcat_monitor.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698