patch.txt

guy, 02/13/2010 08:51 AM

Download (652 Bytes)

 
1
--- bpf.c.orig	2010-02-13 00:31:52.000000000 -0800
2
+++ bpf.c	2010-02-13 00:33:32.000000000 -0800
3
@@ -421,9 +421,12 @@
4
 	 * have arrived to fill the store buffer.
5
 	 */
6
 	while (d->bd_hbuf == NULL) {
7
-		if ((d->bd_immediate || timed_out) && d->bd_slen != 0) {
8
+		if ((d->bd_immediate || (ap->a_ioflag & IO_NDELAY) || timed_out)
9
+		    && d->bd_slen != 0) {
10
 			/*
11
-			 * A packet(s) either arrived since the previous
12
+			 * We're in immediate mode, or are reading
13
+			 * in non-blocking mode, and a packet(s)
14
+			 * either arrived since the previous
15
 			 * read or arrived while we were asleep.
16
 			 * Rotate the buffers and return what's here.
17
 			 */