Commit be4288e2 authored by derat@chromium.org's avatar derat@chromium.org

telemetry: Robustify CrOSInterface._GetSessionManagerPid().

Allow the session_manager process name to use a relative
path or to not have any arguments, rather than requiring it
to have the prefix "/sbin/session_manager " (note trailing
space).

BUG=377301

Review URL: https://codereview.chromium.org/302163004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274225 0039d316-1c4b-4281-b951-d872f2087c98
parent e90ec923
...@@ -297,7 +297,8 @@ class CrOSInterface(object): ...@@ -297,7 +297,8 @@ class CrOSInterface(object):
"""Returns the pid of the session_manager process, given the list of """Returns the pid of the session_manager process, given the list of
processes.""" processes."""
for pid, process, _, _ in procs: for pid, process, _, _ in procs:
if process.startswith('/sbin/session_manager '): argv = process.split()
if argv and os.path.basename(argv[0]) == 'session_manager':
return pid return pid
return None return None
......
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