Lines Matching refs:pid
279 bool waitpid_with_timeout(pid_t pid, int timeout_secs, int* status) { in waitpid_with_timeout() argument
310 pid_t child_pid = waitpid(pid, status, WNOHANG); in waitpid_with_timeout()
311 if (child_pid != pid) { in waitpid_with_timeout()
313 ALOGE("*** Waiting for pid %d, got pid %d instead\n", pid, child_pid); in waitpid_with_timeout()
324 pid_t pid = fork(); in runCommand() local
327 if (pid < 0) { in runCommand()
329 return pid; in runCommand()
333 if (pid == 0) { in runCommand()
352 bool ret = waitpid_with_timeout(pid, timeout_secs, &status); in runCommand()
356 ALOGE("command %s timed out (killing pid %d)", file, pid); in runCommand()
358 ALOGE("command %s: Error (killing pid %d)\n", file, pid); in runCommand()
360 kill(pid, SIGTERM); in runCommand()
361 if (!waitpid_with_timeout(pid, 5, nullptr)) { in runCommand()
362 kill(pid, SIGKILL); in runCommand()
363 if (!waitpid_with_timeout(pid, 5, nullptr)) { in runCommand()
364 ALOGE("could not kill command '%s' (pid %d) even with SIGKILL.\n", file, pid); in runCommand()