diff options
author | bde <bde@FreeBSD.org> | 1997-11-18 16:12:51 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1997-11-18 16:12:51 +0000 |
commit | 8fb85116d49eaf7f67044825632f544752373c3c (patch) | |
tree | a9bcc4add704e50f9885aeb45517e1d6277f6690 /sys/kern/tty_snoop.c | |
parent | 5c59f2f9f5eddcae2c555575c2410fdbd8c0bba9 (diff) | |
download | FreeBSD-src-8fb85116d49eaf7f67044825632f544752373c3c.zip FreeBSD-src-8fb85116d49eaf7f67044825632f544752373c3c.tar.gz |
Removed unused #includes. Ifdefed a conditionally used #include.
Fixed nonblocking mode. It was per-device instead of per-file.
Don't depend on gcc's misfeature of rewriting char args in old-style
function definitions to match wrong prototypes. Break K&R1 support
to fix this quickly.
Diffstat (limited to 'sys/kern/tty_snoop.c')
-rw-r--r-- | sys/kern/tty_snoop.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/sys/kern/tty_snoop.c b/sys/kern/tty_snoop.c index 98ac903..738c871 100644 --- a/sys/kern/tty_snoop.c +++ b/sys/kern/tty_snoop.c @@ -20,20 +20,20 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/filio.h> -#include <sys/ioctl_compat.h> /* Oooh..We need O/NTTYDISC */ +#if defined(COMPAT_43) || defined(COMPAT_SUNOS) +#include <sys/ioctl_compat.h> +#endif #include <sys/proc.h> #include <sys/malloc.h> #include <sys/tty.h> -#include <sys/fcntl.h> #include <sys/conf.h> #include <sys/poll.h> -#include <sys/uio.h> #include <sys/kernel.h> #ifdef DEVFS #include <sys/devfsext.h> #endif /*DEVFS*/ - #include <sys/snoop.h> +#include <sys/vnode.h> static d_open_t snpopen; static d_close_t snpclose; @@ -144,9 +144,8 @@ snpread(dev, uio, flag) do { if (snp->snp_len == 0) { - if (snp->snp_flags & SNOOP_NBIO) { - return EWOULDBLOCK; - } + if (flag & IO_NDELAY) + return (EWOULDBLOCK); snp->snp_flags |= SNOOP_RWAIT; tsleep((caddr_t) snp, (PZERO + 1) | PCATCH, "snoopread", 0); } @@ -186,9 +185,7 @@ snpread(dev, uio, flag) } int -snpinc(snp, c) - struct snoop *snp; - char c; +snpinc(struct snoop *snp, char c) { char buf[1]; @@ -453,10 +450,6 @@ snpioctl(dev, cmd, data, flags, p) break; case FIONBIO: - if (*(int *) data) - snp->snp_flags |= SNOOP_NBIO; - else - snp->snp_flags &= ~SNOOP_NBIO; break; case FIOASYNC: |