PERFORCE change 137445 for review

Robert Watson rwatson at FreeBSD.org
Tue Mar 11 22:17:41 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=137445

Change 137445 by rwatson at rwatson_cinnamon on 2008/03/11 22:16:50

	If the requested timeout is 0, then we want to wait forever, so
	pass NULL to select() for its timeout rather than an
	under-initialized timeval.

Affected files ...

.. //depot/projects/zcopybpf/src/contrib/libpcap/pcap-bpf.c#23 edit

Differences ...

==== //depot/projects/zcopybpf/src/contrib/libpcap/pcap-bpf.c#23 (text+ko) ====

@@ -217,7 +217,8 @@
 		tv.tv_sec = p->to_ms / 1000;
 		tv.tv_usec = (p->to_ms * 1000) % 1000000;
 	}
-	r = select(p->fd + 1, &r_set, NULL, NULL, &tv);
+	r = select(p->fd + 1, &r_set, NULL, NULL, p->to_ms != 0 ? &tv :
+	    NULL);
 	if (r < 0 && errno == EINTR)
 		return (0);
 	else if (r < 0) {


More information about the p4-projects mailing list