From 6ff89b31a25014b18d06f25920ccd1a355903e1f Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 14 Dec 2015 22:08:48 +1100 Subject: [PATCH] Check server fd is still valid as well as having its alive flag set --- src/generator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/generator.c b/src/generator.c index 88bf20b2..2853baf7 100644 --- a/src/generator.c +++ b/src/generator.c @@ -213,8 +213,9 @@ retry: * without blocking on server_alive() */ for (i = 0; i < ckp->btcds; i++) { server_instance_t *si = ckp->servers[i]; + cs = &si->cs; - if (si->alive) { + if (si->alive && cs->fd > 0) { alive = si; goto living; }