mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 01:36:39 +08:00
Fix bug in IO redirection making is possible for the IO redirections to fail in cases where there are multiple pipes and buffers using file descriptors above 2.
darcs-hash:20070107140646-ac50b-dee4f380320ef2743635e77401a789c28d45f805.gz
This commit is contained in:
parent
3fbd8036f4
commit
42d0283489
7
exec.c
7
exec.c
|
@ -203,7 +203,7 @@ void free_fd( io_data_t *io, int fd )
|
|||
if( !io )
|
||||
return;
|
||||
|
||||
if( io->io_mode == IO_PIPE )
|
||||
if( ( io->io_mode == IO_PIPE ) || ( io->io_mode == IO_BUFFER ) )
|
||||
{
|
||||
int i;
|
||||
for( i=0; i<2; i++ )
|
||||
|
@ -214,7 +214,7 @@ void free_fd( io_data_t *io, int fd )
|
|||
{
|
||||
if( (io->param1.pipe_fd[i] = dup(fd)) == -1)
|
||||
{
|
||||
if( errno != EINTR )
|
||||
if( errno != EINTR )
|
||||
{
|
||||
debug( 1,
|
||||
FD_ERROR,
|
||||
|
@ -224,11 +224,14 @@ void free_fd( io_data_t *io, int fd )
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
free_fd( io->next, fd );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user