lib: Check for ECONNRESET as well to detect crashed children.
[ashd.git] / lib / cf.c
index 432f78a..fd53c54 100644 (file)
--- 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);