[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: agetty - progress

David Welton wrote:
> Hi, someone else (Joey H.?, Martin Schulze?) wanted to know about

That was me.  It doesn't run on powerpc yet.

> problems with agetty - and I think I found it.  I haven't started
> investigating yet, but I'm not sure I'm competent to track down the
> exact problem, so I'll post, and then get to work:
> A few lines before 830 of agetty.c, there is
> (while ((c = getc(fd)) != EOF)) .....
> Make gave me the error that this would always return 1, because of the
> incompleteness of the data type.  'c' is a char, EOF == -1.  For some
> reason, this doesn't jive... My man page says that getc returns an
> int, and,infact, the character that is getting dumped to my screen is
> \377 or some such, which would be out of range of a normal
> char... hrmmmm.  An unsigned char doesn't fix it, but an int does.
> This makes agetty function, now login has a problem.. I wonder if it's
> something similiar...

This is only a minor problem - I guess I fixed it by testing against
0xFF or by correcting the data type.

But this is not the main problem.

The main problem is that agetty reads input from the wrong tty.

Say:  I'm starting "agetty tty6" from ttyp1 (via ssh).  I can type
the login (perhaps the password, too, I don't remember at the moment)
on tty6 - the sixth virtual console.

Then I get a shell end everything is displayed on tty2, as expected.
However I can't type on tty2, well, I can, but it doesn't matter.
agetty reads input from ttyp1 instead, which is bad...



Beware of bugs in the above code; I have only proved it correct,
not tried it.  -- Donald E. Knuth

Reply to: