bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix t_addr assignment in lpropen


From: Flavio Cruz
Subject: [PATCH] fix t_addr assignment in lpropen
Date: Sat, 2 Jan 2016 00:10:31 +0100
User-agent: Mutt/1.5.24 (2015-08-30)

* i386/i386at/lpr.c (lpropen): Fix assignment to t_addr.

---
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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]