From bb97a6adacefe2d01ed94a82c0d02801c7e884b1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 4 Dec 1997 08:10:49 +0000 Subject: allow for zero size reads in asyncdns. These can happen after a signal (This used to be commit 8bac91a6e7a3601b093cb64e9cb3bcc1663fb4d4) --- source3/nmbd/asyncdns.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/nmbd/asyncdns.c b/source3/nmbd/asyncdns.c index c87e090754..f15880080f 100644 --- a/source3/nmbd/asyncdns.c +++ b/source3/nmbd/asyncdns.c @@ -162,13 +162,16 @@ void run_dns_queue(void) { struct query_record r; struct packet_struct *p, *p2; + int size; if (fd_in == -1) return; - if (read_data(fd_in, (char *)&r, sizeof(r)) != sizeof(r)) { - DEBUG(0,("Incomplete DNS answer from child!\n")); - fd_in = -1; + if ((size=read_data(fd_in, (char *)&r, sizeof(r))) != sizeof(r)) { + if (size) { + DEBUG(0,("Incomplete DNS answer from child!\n")); + fd_in = -1; + } return; } -- cgit