lkml.org 
[lkml]   [2014]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute
On 02/23/2014 04:05 PM, David Herrmann wrote:
> Hi
>
> On Sun, Feb 23, 2014 at 1:20 AM, Ray Strode <halfline@gmail.com> wrote:
>> Hi,
>>
>>
>> On Feb 22, 2014 9:27 AM, "David Herrmann" <dh.herrmann@gmail.com> wrote:
>>> How about this:
>>>
>>> + driver = cs[i]->device(cs[i], &index);
>>> + /* special case for tty0 which must not be resolved */
>>> + if (driver && (index > 0 || cs[i]->major != TTY_MAJOR)) {
>>> + count += tty_line_name(driver, index, buf +
>>> count);
>>> + count += sprintf(buf + count, "%c", i ? ' ':'\n');
>>> + } else
>>> + count += sprintf(buf + count, "%s%d%c",
>>> + name, index, i ? ' ':'\n');
>>
>> Assuming I'm reading the code correctly, I don't think that will work.
>> Index will be rewritten from 0 to fg_console (which I suppose is going to be
>> 1) after the device vfunc is called.
>
> Oh, nice catch. We have to use cs[i]->index of course. I only
> hand-edited the patch, I didn't even compile-test. But I guess you get
> the idea of special-casing tty0.
>
Okay, that's a good idea.

I'll be redoing the patch.

Cheers,

Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2014-02-24 11:41    [W:0.115 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site