Add 600ms timeout for waitpid
This commit is contained in:
@@ -115,7 +115,12 @@ class GuardedProcess(cmd: String*) {
|
||||
private def destroyProcess() {
|
||||
if (Build.VERSION.SDK_INT < 24) {
|
||||
JniHelper.sigtermCompat(process)
|
||||
process.waitFor()
|
||||
var tries = 0
|
||||
while (JniHelper.waitpidCompat(process) == 0 && tries < 3) {
|
||||
Log.w(TAG, "still waiting for process " + Commandline.toString(cmd))
|
||||
Thread.sleep(200)
|
||||
tries += 1
|
||||
}
|
||||
}
|
||||
process.destroy()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user