From: Fredrik Tolf Date: Tue, 15 Jan 2013 07:21:08 +0000 (+0100) Subject: lib: Use nonblocking-behavior forwarding explicitly for cf-using programs. X-Git-Tag: 0.12~6^2~3 X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=commitdiff_plain;h=3d74fc074c6cdb453061be14fd79723b8244bbf0 lib: Use nonblocking-behavior forwarding explicitly for cf-using programs. --- diff --git a/lib/cf.c b/lib/cf.c index 38d9808..96181ee 100644 --- a/lib/cf.c +++ b/lib/cf.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #ifdef HAVE_CONFIG_H @@ -309,12 +310,12 @@ static int stdhandle(struct child *ch, struct hthead *req, int fd, void (*chinit if(i->type == CH_SOCKET) { if(i->fd < 0) i->fd = stdmkchild(i->argv, chinit, idata); - if(sendreq(i->fd, req, fd)) { + if(sendreq2(i->fd, req, fd, MSG_NOSIGNAL | MSG_DONTWAIT)) { if((errno == EPIPE) || (errno == ECONNRESET)) { /* Assume that the child has crashed and restart it. */ close(i->fd); i->fd = stdmkchild(i->argv, chinit, idata); - if(!sendreq(i->fd, req, fd)) + if(!sendreq2(i->fd, req, fd, MSG_NOSIGNAL | MSG_DONTWAIT)) return(0); } flog(LOG_ERR, "could not pass on request to child %s: %s", ch->name, strerror(errno));