From: Fredrik Tolf Date: Sat, 23 Oct 2010 15:00:28 +0000 (+0200) Subject: lib: Check for ECONNRESET as well to detect crashed children. X-Git-Tag: 0.4~10 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=f2df7a1b1aeeb0cec2309aeb62fae051fd3c687c;hp=48a91dd9f3bce22911839aa678ebe9a6bafab5fc;p=ashd.git lib: Check for ECONNRESET as well to detect crashed children. --- diff --git a/lib/cf.c b/lib/cf.c index 432f78a..fd53c54 100644 --- a/lib/cf.c +++ b/lib/cf.c @@ -332,7 +332,7 @@ int childhandle(struct child *ch, struct hthead *req, int fd, void (*chinit)(voi if(ch->fd < 0) ch->fd = stdmkchild(ch->argv, chinit, idata); if(sendreq(ch->fd, req, fd)) { - if(errno == EPIPE) { + if((errno == EPIPE) || (errno == ECONNRESET)) { /* Assume that the child has crashed and restart it. */ close(ch->fd); ch->fd = stdmkchild(ch->argv, chinit, idata); diff --git a/src/userplex.c b/src/userplex.c index d6c978c..3a2da87 100644 --- a/src/userplex.c +++ b/src/userplex.c @@ -145,7 +145,7 @@ static void serve2(struct user *usr, struct hthead *req, int fd) if(usr->fd < 0) usr->fd = forkchild(usr->name); if(sendreq(usr->fd, req, fd)) { - if(errno == EPIPE) { + if((errno == EPIPE) || (errno == ECONNRESET)) { /* Assume that the child has crashed and restart it. */ close(usr->fd); usr->fd = forkchild(usr->name);