Lines Matching refs:pid
421 static int thermometer_execute(int argc, char *argv[], char *const envp[], pid_t *pid) in thermometer_execute() argument
426 *pid = fork(); in thermometer_execute()
427 if (*pid < 0) { in thermometer_execute()
432 if (!(*pid)) { in thermometer_execute()
442 pid_t pid = *(pid_t *)arg; in kill_process() local
444 if (kill(pid, SIGTERM)) in kill_process()
445 ERROR("Failed to send SIGTERM signal to '%d': %p\n", pid); in kill_process()
446 else if (waitpid(pid, NULL, 0)) in kill_process()
447 ERROR("Failed to wait pid '%d': %p\n", pid); in kill_process()
460 static int thermometer_wait(struct options *options, pid_t pid) in thermometer_wait() argument
486 if (mainloop_add(fd, pid < 0 ? exit_mainloop : kill_process, &pid)) { in thermometer_wait()
542 pid_t pid = -1; in main() local
562 if (thermometer_execute(argc - optind, &argv[optind], envp, &pid)) in main()
565 if (thermometer_wait(&options, pid)) in main()