r = recvmsg (w->fd, &msg, 0);
if (r == -1) {
- msg_err ("cannot read from worker's srv pipe: %s",
- strerror (errno));
+ if (errno != EAGAIN) {
+ msg_err ("cannot read from worker's srv pipe: %s",
+ strerror(errno));
+ }
+ else {
+ return;
+ }
}
else if (r == 0) {
/*
#endif
}
+#ifndef SOCK_SEQPACKET
+#define SOCK_SEQPACKET SOCK_DGRAM
+#endif
struct rspamd_worker *
rspamd_fork_worker (struct rspamd_main *rspamd_main,
struct rspamd_worker_conf *cf,
/* Starting worker process */
wrk = (struct rspamd_worker *) g_malloc0 (sizeof (struct rspamd_worker));
- if (!rspamd_socketpair (wrk->control_pipe, SOCK_DGRAM)) {
+ if (!rspamd_socketpair (wrk->control_pipe, SOCK_SEQPACKET)) {
msg_err ("socketpair failure: %s", strerror (errno));
rspamd_hard_terminate (rspamd_main);
}
- if (!rspamd_socketpair (wrk->srv_pipe, SOCK_DGRAM)) {
+ if (!rspamd_socketpair (wrk->srv_pipe, SOCK_SEQPACKET)) {
msg_err ("socketpair failure: %s", strerror (errno));
rspamd_hard_terminate (rspamd_main);
}