diff options
author | qiwang <wangqi_a@xiaomi.com> | 2019-08-22 11:25:30 +0800 |
---|---|---|
committer | Chris Wailes <chriswailes@google.com> | 2019-09-04 16:42:19 -0700 |
commit | 1e7467f320d1ed78eeab51adc22cf96f32d9b0df (patch) | |
tree | 2c8bb53358be41e19d48ebcbcace4aeda9ee4a9c /startop/scripts/lib/cmd_utils.py | |
parent | 222eaf9fc1a6c1e2c6de977d372bb35ca2084ed5 (diff) |
Don't clear the output array if it failed to open the proc status file
According to the original documentation, the functions in Process.java
should return -1 when the process doesn't exist,this should be detected
by Process.readProcLine() when it fails to open the /proc/<pid>/status
file. Unfortunately readProcLine() zeroes-out the output array before
attempting to open the file, so the expected return value -1 is changed
to be 0 when the process doesn't exist. It's inconsistent with the
interface description definition, so correct it.
Test: try to use Process.getUidForPid(int pid) api to read a non-existent
process pid's uid, it will return -1 instead of 0.
Change-Id: Ic2ac7defea8b15dd65f907d04e168a1283a4f621
Signed-off-by: qiwang <wangqi_a@xiaomi.com>
Diffstat (limited to 'startop/scripts/lib/cmd_utils.py')
0 files changed, 0 insertions, 0 deletions