patch-1.3.99 linux/drivers/char/lp.c
Next file: linux/drivers/char/lp_m68k.c
Previous file: linux/drivers/char/istallion.c
Back to the patch index
Back to the overall index
-  Lines: 45
 -  Date:
Mon May  6 13:20:19 1996
 -  Orig file: 
v1.3.98/linux/drivers/char/lp.c
 -  Orig date: 
Sun May  5 08:51:59 1996
 
diff -u --recursive --new-file v1.3.98/linux/drivers/char/lp.c linux/drivers/char/lp.c
@@ -183,14 +183,14 @@
 				if (lp_table[minor].runchars > LP_STAT(minor).maxrun)
 					 LP_STAT(minor).maxrun = lp_table[minor].runchars;
 				status = LP_S(minor);
-				if ((status & LP_OFFL) || !(status & LP_PSELECD)) {
-					printk(KERN_INFO "lp%d off-line\n", minor);
-					if (LP_F(minor) & LP_ABORT)
-						return rc?rc:-EIO;
-				} else if ((status & LP_POUTPA)) {
+				if ((status & LP_POUTPA)) {
 					printk(KERN_INFO "lp%d out of paper\n", minor);
 					if (LP_F(minor) & LP_ABORT)
 						return rc?rc:-ENOSPC;
+				} else if (!(status & LP_PSELECD)) {
+					printk(KERN_INFO "lp%d off-line\n", minor);
+					if (LP_F(minor) & LP_ABORT)
+						return rc?rc:-EIO;
 				} else if (!(status & LP_PERRORP)) {
 					printk(KERN_ERR "lp%d printer error\n", minor);
 					if (LP_F(minor) & LP_ABORT)
@@ -248,18 +248,18 @@
 				 LP_STAT(minor).maxrun = lp_table[minor].runchars;
 			status = LP_S(minor);
 
-			if ((status & LP_OFFL) || !(status & LP_PSELECD)) {
-				printk(KERN_INFO "lp%d off-line\n", minor);
+			if (status & LP_POUTPA) {
+				printk(KERN_INFO "lp%d out of paper\n", minor);
 				if(LP_F(minor) & LP_ABORT)
-					return temp-buf?temp-buf:-EIO;
+					return temp-buf?temp-buf:-ENOSPC;
 				current->state = TASK_INTERRUPTIBLE;
 				current->timeout = jiffies + LP_TIMEOUT_POLLED;
 				schedule();
 			} else
-			if (status & LP_POUTPA) {
-				printk(KERN_INFO "lp%d out of paper\n", minor);
+			if (!(status & LP_PSELECD)) {
+				printk(KERN_INFO "lp%d off-line\n", minor);
 				if(LP_F(minor) & LP_ABORT)
-					return temp-buf?temp-buf:-ENOSPC;
+					return temp-buf?temp-buf:-EIO;
 				current->state = TASK_INTERRUPTIBLE;
 				current->timeout = jiffies + LP_TIMEOUT_POLLED;
 				schedule();
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this