From 852fa3b2e32719d094f3ad6513238841ae1f078b Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 22 Jan 2002 02:38:34 +0000 Subject: [PATCH] 1183. [bug] Handle ENOSR error when writing to the internal control pipe. [RT #2395] --- CHANGES | 3 +++ lib/isc/unix/socket.c | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index afeed962e8..ad76c227ff 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1183. [bug] Handle ENOSR error when writing to the internal + control pipe. [RT #2395] + 1182. [bug] The server could throw an assertion failure when constructing a negative response packet. diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index b5daffaf4e..4d2fcd4ed0 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.c,v 1.219 2001/12/19 05:51:34 marka Exp $ */ +/* $Id: socket.c,v 1.220 2002/01/22 02:38:34 marka Exp $ */ #include @@ -378,6 +378,16 @@ select_poke(isc_socketmgr_t *mgr, int fd, int msg) { do { cc = write(mgr->pipe_fds[1], buf, sizeof(buf)); +#ifdef ENOSR + /* + * Treat ENOSR as EAGAIN but loop slowly as it is + * unlikely to clear fast. + */ + if (cc < 0 && errno == ENOSR) { + sleep(1); + errno = EAGAIN; + } +#endif } while (cc < 0 && SOFT_ERROR(errno)); if (cc < 0) {