Fix login(8) reopen of /dev/tty as stdout.

This commit is contained in:
Jonas 'Sortie' Termansen 2016-11-18 18:44:48 +01:00
parent 3cfbdb29b5
commit 4441e279d7
1 changed files with 1 additions and 1 deletions

View File

@ -405,7 +405,7 @@ int main(void)
if ( !isatty(1) )
{
close(1);
if ( open("/dev/tty", O_WRONLY) != 0 )
if ( open("/dev/tty", O_WRONLY) != 1 )
err(2, "/dev/tty");
}
if ( !isatty(2) )