- int pid = (proc_data->pid > 0) ? proc_data->pid : -(proc_data->pid);
-
- // waitpid is POSIX so should be available everywhere, however on older
- // systems wait() might be used instead in a loop (until the right pid
- // terminates)
- int status = 0;
- int rc;
-
- // wait for child termination and if waitpid() was interrupted, try again
- do
- {
- rc = waitpid(pid, &status, 0);
- }
- while ( rc == -1 && errno == EINTR );
-