From f2df7a1b1aeeb0cec2309aeb62fae051fd3c687c Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Sat, 23 Oct 2010 17:00:28 +0200 Subject: [PATCH] lib: Check for ECONNRESET as well to detect crashed children. --- lib/cf.c | 2 +- src/userplex.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); -- 2.11.0