projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sun merge
[unix-history]
/
usr
/
src
/
sys
/
vax
/
uba
/
lp.c
diff --git
a/usr/src/sys/vax/uba/lp.c
b/usr/src/sys/vax/uba/lp.c
index
554a376
..
cb7e2f5
100644
(file)
--- a/
usr/src/sys/vax/uba/lp.c
+++ b/
usr/src/sys/vax/uba/lp.c
@@
-1,4
+1,4
@@
-/* lp.c 4.
27 82/08/22
*/
+/* lp.c 4.
31 82/12/17
*/
#include "lp.h"
#if NLP > 0
#include "lp.h"
#if NLP > 0
@@
-8,6
+8,7
@@
* This driver has been modified to work on printers where
* leaving IENABLE set would cause continuous interrupts.
*/
* This driver has been modified to work on printers where
* leaving IENABLE set would cause continuous interrupts.
*/
+#include "../machine/pte.h"
#include "../h/param.h"
#include "../h/dir.h"
#include "../h/param.h"
#include "../h/dir.h"
@@
-15,10
+16,8
@@
#include "../h/buf.h"
#include "../h/systm.h"
#include "../h/map.h"
#include "../h/buf.h"
#include "../h/systm.h"
#include "../h/map.h"
-#include "../h/pte.h"
-#include "../h/ubavar.h"
-#include "../h/ioctl.h"
-#include "../h/tty.h"
+
+#include "../vaxuba/ubavar.h"
#define LPPRI (PZERO+8)
#define IENABLE 0100
#define LPPRI (PZERO+8)
#define IENABLE 0100
@@
-110,15
+109,11
@@
lpopen(dev, flag)
if ((unit = LPUNIT(dev)) >= NLP ||
(sc = &lp_softc[unit])->sc_state&OPEN ||
if ((unit = LPUNIT(dev)) >= NLP ||
(sc = &lp_softc[unit])->sc_state&OPEN ||
- (ui = lpinfo[unit]) == 0 || ui->ui_alive == 0) {
- u.u_error = ENXIO;
- return;
- }
+ (ui = lpinfo[unit]) == 0 || ui->ui_alive == 0)
+ return (ENXIO);
lpaddr = (struct lpdevice *)ui->ui_addr;
lpaddr = (struct lpdevice *)ui->ui_addr;
- if (lpaddr->lpsr&ERROR) {
- u.u_error = EIO;
- return;
- }
+ if (lpaddr->lpsr&ERROR)
+ return (EIO);
sc->sc_state |= OPEN;
sc->sc_inbuf = geteblk(512);
sc->sc_flags = minor(dev) & 07;
sc->sc_state |= OPEN;
sc->sc_inbuf = geteblk(512);
sc->sc_flags = minor(dev) & 07;
@@
-129,6
+124,7
@@
lpopen(dev, flag)
}
(void) spl0();
lpcanon(dev, '\f');
}
(void) spl0();
lpcanon(dev, '\f');
+ return (0);
}
/*ARGSUSED*/
}
/*ARGSUSED*/
@@
-150,16
+146,18
@@
lpwrite(dev, uio)
register unsigned n;
register char *cp;
register struct lp_softc *sc = &lp_softc[LPUNIT(dev)];
register unsigned n;
register char *cp;
register struct lp_softc *sc = &lp_softc[LPUNIT(dev)];
+ int error;
while (n = min(512, uio->uio_resid)) {
cp = sc->sc_inbuf->b_un.b_addr;
while (n = min(512, uio->uio_resid)) {
cp = sc->sc_inbuf->b_un.b_addr;
-
u.u_
error = uiomove(cp, n, UIO_WRITE, uio);
- if (
u.u_
error)
-
break
;
+ error = uiomove(cp, n, UIO_WRITE, uio);
+ if (error)
+
return (error)
;
do
lpcanon(dev, *cp++);
while (--n);
}
do
lpcanon(dev, *cp++);
while (--n);
}
+ return (0);
}
lpcanon(dev, c)
}
lpcanon(dev, c)