Lines Matching refs:pid
274 bool waitpid_with_timeout(pid_t pid, int timeout_secs, int* status) { in waitpid_with_timeout() argument
305 pid_t child_pid = waitpid(pid, status, WNOHANG); in waitpid_with_timeout()
306 if (child_pid != pid) { in waitpid_with_timeout()
308 ALOGE("*** Waiting for pid %d, got pid %d instead\n", pid, child_pid); in waitpid_with_timeout()
319 pid_t pid = fork(); in runCommand() local
322 if (pid < 0) { in runCommand()
324 return pid; in runCommand()
328 if (pid == 0) { in runCommand()
347 bool ret = waitpid_with_timeout(pid, timeout_secs, &status); in runCommand()
351 ALOGE("command %s timed out (killing pid %d)", file, pid); in runCommand()
353 ALOGE("command %s: Error (killing pid %d)\n", file, pid); in runCommand()
355 kill(pid, SIGTERM); in runCommand()
356 if (!waitpid_with_timeout(pid, 5, nullptr)) { in runCommand()
357 kill(pid, SIGKILL); in runCommand()
358 if (!waitpid_with_timeout(pid, 5, nullptr)) { in runCommand()
359 ALOGE("could not kill command '%s' (pid %d) even with SIGKILL.\n", file, pid); in runCommand()