mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-18 18:52:44 +08:00
Try to dup stderr if fopen(ttyname) fails on init (Needed when using su)
darcs-hash:20051012103638-ac50b-5a114b1adaa83ef48dd5c4821138c1c7af660204.gz
This commit is contained in:
parent
4636b783a0
commit
4aa1b193c9
13
fish_pager.c
13
fish_pager.c
|
@ -848,15 +848,15 @@ static void init()
|
|||
close(1);
|
||||
if( open( ttyname(0), O_WRONLY ) != 1 )
|
||||
{
|
||||
debug( 0, L"Could not set up file descriptors for pager" );
|
||||
exit( 1 );
|
||||
|
||||
if( dup2( 2, 1 ) == -1 )
|
||||
{
|
||||
debug( 0, L"Could not set up file descriptors for pager" );
|
||||
exit( 1 );
|
||||
}
|
||||
}
|
||||
out_file = fdopen( out, "w" );
|
||||
sb_init( &out_buff );
|
||||
|
||||
|
||||
|
||||
env_universal_init( 0, 0, 0, 0);
|
||||
input_common_init( &interrupt_handler );
|
||||
|
||||
|
@ -922,9 +922,6 @@ static void init()
|
|||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
// writembs( tparm( eat_char, ' ', c ) );
|
||||
|
||||
}
|
||||
|
||||
void destroy()
|
||||
|
|
Loading…
Reference in New Issue
Block a user