mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: viro@parcelfarce.linux.theplanet.co.uk
To: Mitch@0Bits.COM
Cc: linux-kernel@vger.kernel.org
Subject: Re: Linux 2.4.21-rc3, writing to /dev/console returns ESPIPE
Date: Sun, 25 May 2003 12:52:34 +0100	[thread overview]
Message-ID: <20030525115234.GD6270@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20030525113912.GB6270@parcelfarce.linux.theplanet.co.uk>

On Sun, May 25, 2003 at 12:39:12PM +0100, viro@parcelfarce.linux.theplanet.co.uk wrote:
> On Sun, May 25, 2003 at 12:22:14PM +0100, Mitch@0Bits.COM wrote:
> > The checkin on linux-2.4.21-rc3/drivers/char/tty_io.c
> > 
> > +       /* Can't seek (pwrite) on ttys.  */
> > +       if (ppos != &file->f_pos)
> > +               return -ESPIPE;
> > 
> > should not be there in my opinion.
> 
> s/not be/be not/

Grrr....  Correct patch follows:

--- drivers/char/tty_io.c	Sat May 17 11:14:02 2003
+++ /tmp/tty_io.c	Sun May 25 07:49:08 2003
@@ -751,6 +751,10 @@
 	struct tty_struct * tty;
 	struct inode *inode = file->f_dentry->d_inode;
 
+	/* Can't seek (pwrite) on ttys.  */
+	if (ppos != &file->f_pos)
+		return -ESPIPE;
+
 	/*
 	 *      For now, we redirect writes from /dev/console as
 	 *      well as /dev/tty0.
@@ -770,15 +774,11 @@
 		spin_unlock(&redirect_lock);
 
 		if (p) {
-			ssize_t res = p->f_op->write(p, buf, count, ppos);
+			ssize_t res = p->f_op->write(p, buf, count, &p->f_pos);
 			fput(p);
 			return res;
 		}
 	}
-
-	/* Can't seek (pwrite) on ttys.  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 
 	tty = (struct tty_struct *)file->private_data;
 	if (tty_paranoia_check(tty, inode->i_rdev, "tty_write"))

      reply	other threads:[~2003-05-25 11:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-25 11:22 Mitch
2003-05-25 11:39 ` viro
2003-05-25 11:52   ` viro [this message]

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=20030525115234.GD6270@parcelfarce.linux.theplanet.co.uk \
    --to=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=Mitch@0Bits.COM \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®