diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2016-01-02 00:10:31 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-01-02 00:20:04 +0100 |
commit | d449859ec8e33055036a5a7bb15bfe4f68282391 (patch) | |
tree | 1d78d7e51ff1d6bf51e0ab189a4443857a815434 | |
parent | 6a5966c285a2b99e26a5dc8f9c4b60c93347df8d (diff) |
fix t_addr assignment in lpropen
* i386/i386at/lpr.c (lpropen): Fix assignment to t_addr.
-rw-r--r-- | i386/i386at/lpr.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c index edeef9f..73c4261 100644 --- a/i386/i386at/lpr.c +++ b/i386/i386at/lpr.c @@ -105,22 +105,24 @@ void lprattach(struct bus_device *dev) } int -lpropen(dev, flag, ior) -dev_t dev; -int flag; -io_req_t ior; +lpropen(dev_t dev, int flag, io_req_t ior) { -int unit = minor(dev); -struct bus_device *isai; -struct tty *tp; -u_short addr; - - if (unit >= NLPR || (isai = lprinfo[unit]) == 0 || isai->alive == 0) - return (D_NO_SUCH_DEVICE); + int unit = minor(dev); + struct bus_device *isai; + struct tty *tp; + u_short addr; + + if (unit >= NLPR) + return D_NO_SUCH_DEVICE; + + isai = lprinfo[unit]; + if (isai == NULL || !isai->alive) + return D_NO_SUCH_DEVICE; + tp = &lpr_tty[unit]; addr = (u_short) isai->address; tp->t_dev = dev; - tp->t_addr = *(caddr_t *)&addr; + tp->t_addr = addr; tp->t_oproc = lprstart; tp->t_state |= TS_WOPEN; tp->t_stop = lprstop; |