void *data)
{
candidate_process_context_t *cpc = data;
+ int recv_pid = -1;
+ int ret;
if (cpc == NULL)
return false;
return false;
}
+ if (cond & IO_IN) {
+ ret = recv(cpc->hydra_fd, &recv_pid, sizeof(recv_pid),
+ MSG_WAITALL);
+ if (ret == -1) {
+ _E("recv() is failed. errno(%d)", errno);
+ } else {
+ _W("candidate process: %d", recv_pid);
+ if (recv_pid > 1)
+ cpc->pid = recv_pid;
+ }
+ }
+
return true;
}
__context.candidate_pid = __fork_process(__run_loader, NULL);
_D("[__HYDRA__] candidate process(%d)", __context.candidate_pid);
+ len = send(fd, &__context.candidate_pid,
+ sizeof(__context.candidate_pid), MSG_NOSIGNAL);
+ if (len == -1)
+ _E("[__HYDRA__] send() is failed. errno(%d)", errno);
return 0;
err:
__context.candidate_pid = __fork_process(__run_loader, NULL);
_D("[__HYDRA__] candidate process(%d)", __context.candidate_pid);
+ if (send(__context.client_fd, &__context.candidate_pid,
+ sizeof(__context.candidate_pid),
+ MSG_NOSIGNAL) == -1)
+ _E("[__HYDRA__] send() is failed. errno(%d)", errno);
__run_loop();