static void sig_child_handler(int signo, siginfo_t *info, void *data)
{
- pid_t pid;
+ pid_t ret;
int status;
if (!info || signo != SIGCHLD)
return;
- pid = waitpid(info->si_pid, &status, 0);
- if (pid == -1) {
- _E("SIGCHLD received.\n");
- return;
- }
-
- _D("Sig child actend call - %d\n", info->si_pid);
+ ret = waitpid(info->si_pid, &status, 0);
+ if (ret >= 0)
+ _D("SIGCHLD from %d handled successfully.", ret);
+ else if (ret == -1 && errno != ECHILD)
+ _E("Failed to handle SIGCHLD(%d).", errno);
}
static void sig_pipe_handler(int signo, siginfo_t *info, void *data)