aboutsummaryrefslogtreecommitdiffhomepage
path: root/exec.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2007-01-08 00:06:46 +1000
committerGravatar axel <axel@liljencrantz.se>2007-01-08 00:06:46 +1000
commit42d02834892c7c7ac165d46c08d55ecfe9e8b643 (patch)
tree5807b63730d21bb1e1bb4e790d91d7676647a464 /exec.c
parent3fbd8036f4b7b535aa60569b28ce9a3a2eee45d0 (diff)
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
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/exec.c b/exec.c
index e4511394..2388d965 100644
--- a/exec.c
+++ b/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 );
}
/**