lkml.org 
[lkml]   [2009]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Remove pty_ops_bsd and pty_bsd_ioctl() as they're not used


On Tue, 29 Sep 2009, David Howells wrote:
>
> Is it right to use pty_ops_bsd in _both_ places? Looking at the code in
> linux-2.6.0, the BSD ioctl only applies to the master and doesn't apply to the
> slave.

Right you are, good catch.

That said, I have to say that this whole pty lock thing seems to have been
broken since 2.6.26, and even now, nobody actually _complained_. You found
the problem due to a compiler warning rather than due to somebody noticing
that pty_bsd_ioctl() is no longer hooked up.

Because as far as I can tell, the bug was introduced by commit
3e8e88ca053150efdbecb45d8f481cf560ec808d ("pty: prepare for tty->ops
changes") back in April of 2008. That added the whole 'pty_ops_bsd'
structure, but it has never actually been used.

So I do wonder whether the right thing to do would not be to simple remove
the whole pty_ops_bsd code entirely. Or maybe mode the trivial TIOCSPTLCK
into the generic tty ioctl handling, and just make it test for
"driver->subtype == PTY_TYPE_MASTER" - and at least get rid of this subtle
thing that was broken for over a year without anybody noticing..

Linus


\
 
 \ /
  Last update: 2009-10-18 23:28    [W:0.074 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site