assert(pid >= -1);
if (pid > 0 && waitpid(pid, NULL, WNOHANG) == 0)
+ {
kill(pid, SIGTERM);
+ while (waitpid(pid, NULL, 0) == -1)
+ if (errno != EINTR)
+ {
+ assert(!"invalid pid in auto_kill_proc_closer");
+ break;
+ }
+ }
}
void auto_wait_proc_closer::operator()(pid_t pid) const