From 8fb85116d49eaf7f67044825632f544752373c3c Mon Sep 17 00:00:00 2001 From: bde Date: Tue, 18 Nov 1997 16:12:51 +0000 Subject: 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. --- sys/dev/snp/snp.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'sys/dev/snp') diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c index 98ac903..738c871 100644 --- a/sys/dev/snp/snp.c +++ b/sys/dev/snp/snp.c @@ -20,20 +20,20 @@ #include #include #include -#include /* Oooh..We need O/NTTYDISC */ +#if defined(COMPAT_43) || defined(COMPAT_SUNOS) +#include +#endif #include #include #include -#include #include #include -#include #include #ifdef DEVFS #include #endif /*DEVFS*/ - #include +#include 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: -- cgit v1.1