Reintroduce IO transmorgrification (yuck) to fix problems with fish_config and complicated IO redirections

This commit is contained in:
ridiculousfish
2012-08-22 13:41:21 -07:00
parent 04ea680e9a
commit f5d4e3f94c
2 changed files with 133 additions and 10 deletions

View File

@@ -169,10 +169,6 @@ static int handle_child_io( io_chain_t &io_chain )
io_data_t *io = io_chain.at(idx);
int tmp;
/* If this is not the last IO redirection for this fd, then skip it. This comes about because of the funky way in which we list IO redirections: every process in a job gets the input and output redirections, even internal ones. For example, in 'cat < foo | cat | cat > bar', the middle cat sees both < foo and > bar. It also gets pipes for its fd 0 and 1, which appear after in the list. */
if (io != io_chain.get_io_for_fd(io->fd))
continue;
if( io->io_mode == IO_FD && io->fd == io->param1.old_fd )
{
continue;
@@ -444,10 +440,6 @@ bool fork_actions_make_spawn_properties(posix_spawnattr_t *attr, posix_spawn_fil
{
const io_data_t *io = j->io.at(idx);
/* If this is not the last IO redirection for this fd, then skip it. This comes about because of the funky way in which we list IO redirections: every process in a job gets the input and output redirections, even internal ones. For example, in 'cat < foo | cat | cat > bar', the middle cat sees both < foo and > bar. It also gets pipes for its fd 0 and 1, which appear after in the list. */
if (io != j->io.get_io_for_fd(io->fd))
continue;
if( io->io_mode == IO_FD && io->fd == io->param1.old_fd )
{
continue;