All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Waugh <twaugh@redhat.com>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Peter Osterlund <peter.osterlund@mailbox.swipnet.se>,
	linux-kernel@vger.kernel.org
Subject: Re: Printing to off-line printer in 2.4.0-prerelease
Date: Thu, 4 Jan 2001 14:20:43 +0000	[thread overview]
Message-ID: <20010104142043.N23469@redhat.com> (raw)
In-Reply-To: <m2k88czda4.fsf@ppro.localdomain> <20010104112027.G23469@redhat.com> <20010104145229.E17640@athlon.random>
In-Reply-To: <20010104145229.E17640@athlon.random>; from andrea@suse.de on Thu, Jan 04, 2001 at 02:52:29PM +0100

On Thu, Jan 04, 2001 at 02:52:29PM +0100, Andrea Arcangeli wrote:

> I think lp_check_status.

Okay.  So what about this patch instead?  If the printer is off-line
to start with, fall into parport_write anyway (it will just time out
and return 0).  If LP_ABORT is set, we return -EAGAIN.

Tim.
*/

--- lp.c~	Thu Jan  4 11:04:30 2001
+++ lp.c	Thu Jan  4 14:16:42 2001
@@ -213,7 +213,7 @@
 			last = LP_PSELECD;
 			printk(KERN_INFO "lp%d off-line\n", minor);
 		}
-		error = -EIO;
+		error = -EAGAIN;
 	} else if (!(status & LP_PERRORP)) {
 		if (last != LP_PERRORP) {
 			last = LP_PERRORP;
@@ -270,8 +270,11 @@
 	parport_set_timeout (lp_table[minor].dev,
 			     lp_table[minor].timeout);
 
-	if ((retv = lp_check_status (minor)) == 0)
-	do {
+	retv = lp_check_status (minor);
+	if (retv == -EAGAIN && (LP_F(minor) & LP_ABORT) == 0)
+		retv = 0;
+
+	if (retv == 0) do {
 		/* Write the data. */
 		written = parport_write (port, kbuf, copy_size);
 		if (written >= 0) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-04 14:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-03 18:44 Printing to off-line printer in 2.4.0-prerelease Peter Osterlund
2001-01-03 19:13 ` Andrea Arcangeli
2001-01-03 21:00   ` Peter Osterlund
2001-01-03 21:35     ` Andrea Arcangeli
2001-01-04  0:08       ` Peter Osterlund
2001-01-04  0:41         ` Andrea Arcangeli
2001-01-04  1:09           ` Peter Osterlund
2001-01-04  1:39             ` Andrea Arcangeli
2001-01-04 11:17               ` Tim Waugh
2001-01-04  9:27         ` Tim Waugh
2001-01-04 13:50           ` Andrea Arcangeli
2001-01-04 11:20 ` Tim Waugh
2001-01-04 13:52   ` Andrea Arcangeli
2001-01-04 14:20     ` Tim Waugh [this message]
2001-01-04 14:39       ` Andrea Arcangeli
2001-01-04 14:54         ` Tim Waugh
2001-01-04 19:45           ` Peter Osterlund
2001-01-04 19:07       ` Peter Osterlund
2001-01-04 21:52         ` Tim Waugh
2001-01-05  0:33           ` Peter Osterlund
  -- strict thread matches above, loose matches on Subject: below --
2001-01-04 15:30 Jesse Pollard
2001-01-04 19:22 ` Gunther Mayer
2001-01-05  1:13   ` Jesse Pollard
2001-01-04 23:20 ` David Ford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010104142043.N23469@redhat.com \
    --to=twaugh@redhat.com \
    --cc=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.osterlund@mailbox.swipnet.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.