aboutsummaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1997-11-18 16:29:53 +0000
committerBruce Evans <bde@FreeBSD.org>1997-11-18 16:29:53 +0000
commitfba9235d76502eea2a41870b3aa32f107f4140a1 (patch)
tree8bb4e21fc779be96ad9580a7266cfae9402ce5e2 /sys/net
parente81b65dbdcd5a372908665a4b7dd88a0de7e0222 (diff)
downloadsrc-fba9235d76502eea2a41870b3aa32f107f4140a1.tar.gz
src-fba9235d76502eea2a41870b3aa32f107f4140a1.zip
Removed unused #includes.
Fixed nonblocking mode. It was per-device instead of per-file. This also fixes clobbering of bd_rtout by overloading it to hold a wrong version of the blocking flag. I hope nothing depends on the bugs.
Notes
Notes: svn path=/head/; revision=31282
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index e1740dca620a..fa41365619ce 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -37,7 +37,7 @@
*
* @(#)bpf.c 8.2 (Berkeley) 3/28/94
*
- * $Id: bpf.c,v 1.34 1997/09/16 11:43:42 bde Exp $
+ * $Id: bpf.c,v 1.35 1997/10/03 21:32:05 julian Exp $
*/
#include "bpfilter.h"
@@ -55,7 +55,6 @@
#include <sys/conf.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
-#include <sys/buf.h>
#include <sys/time.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
@@ -63,28 +62,22 @@
#include <sys/sockio.h>
#include <sys/ttycom.h>
-#include <sys/fcntl.h>
#if defined(sparc) && BSD < 199103
#include <sys/stream.h>
#endif
-#include <sys/uio.h>
#include <sys/poll.h>
#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <net/if.h>
+#include <sys/vnode.h>
+#include <net/if.h>
#include <net/bpf.h>
#include <net/bpfdesc.h>
-#include <sys/errno.h>
-
#include <netinet/in.h>
#include <netinet/if_ether.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
-#include <sys/conf.h>
#ifdef DEVFS
#include <sys/devfsext.h>
#endif /*DEVFS*/
@@ -465,11 +458,11 @@ bpfread(dev, uio, ioflag)
ROTATE_BUFFERS(d);
break;
}
- if (d->bd_rtout != -1)
+ if (ioflag & IO_NDELAY)
+ error = EWOULDBLOCK;
+ else
error = BPF_SLEEP((caddr_t)d, PRINET|PCATCH, "bpf",
d->bd_rtout);
- else
- error = EWOULDBLOCK; /* User requested non-blocking I/O */
if (error == EINTR || error == ERESTART) {
splx(s);
return (error);
@@ -822,12 +815,7 @@ bpfioctl(dev, cmd, addr, flags, p)
break;
}
-
case FIONBIO: /* Non-blocking I/O */
- if (*(int *)addr)
- d->bd_rtout = -1;
- else
- d->bd_rtout = 0;
break;
case FIOASYNC: /* Send signal on receive packets */