diff options
Diffstat (limited to 'src/exec.c')
| -rw-r--r-- | src/exec.c | 14 |
1 files changed, 0 insertions, 14 deletions
@@ -47,8 +47,6 @@ void source_script(char* fname, ShellState* shstate) { bool handle_builtin(ExecutableCommand cmd, ShellState* shstate) { MaybeStrPair m_assignment; assert(cmd.args[0] != NULL); - // TODO: handle id=value assignments - m_assignment = parse_assignment(cmd.args[0]); if (m_assignment.some) { set_map_pair(&shstate->shell_vars, m_assignment.value); @@ -154,24 +152,19 @@ ExecutableCommand process_pl_command(PlCommand pl_cmd, int* pgid, ShellState* sh pipe(ps_pipe_fds); Channel write_cha = {.fd = ps_pipe_fds[1], .parent_proc_closable = true, .child_proc_closable = true}; execute_command_pipeline(*(Pipeline*)arg.as.sub_pipeline, STDIN_CHA, write_cha, false, pgid, shstate); - //close(ps_pipe_fds[1]); - push_to_ChannelVec(&other_open_channels, (Channel){.fd = ps_pipe_fds[0], .parent_proc_closable = true, .child_proc_closable = false}); char pname[64]; snprintf(pname, sizeof(pname), "/dev/fd/%d", ps_pipe_fds[0]); push_to_StrVec(&arg_vec, strdup(pname)); break; case ARG_PS_OUT: - // TODO: do waiting correctly pipe(ps_pipe_fds); - // TODO: don't do fcntl? fcntl(ps_pipe_fds[1], F_SETFD, FD_CLOEXEC); Channel read_cha = {.fd = ps_pipe_fds[0], .parent_proc_closable = true, .child_proc_closable = true}; execute_command_pipeline(*(Pipeline*)arg.as.sub_pipeline, read_cha, STDOUT_CHA, false, pgid, shstate); fcntl(ps_pipe_fds[1], F_SETFD, 0); push_to_ChannelVec(&other_open_channels, (Channel){.fd = ps_pipe_fds[0], .parent_proc_closable = true, .child_proc_closable = false}); - //close(ps_pipe_fds[0]); char name[64]; snprintf(name, sizeof(name), "/dev/fd/%d", ps_pipe_fds[1]); push_to_StrVec(&arg_vec, strdup(name)); @@ -286,10 +279,3 @@ void execute_command_pipeline(Pipeline pipeline, Channel read_cha, Channel write tcsetpgrp(STDIN_FILENO, getpgrp()); } } - -void execute_pipeline_tree(Pipeline root_pl, ShellState* shstate, int stdin_fd, int stdout_fd) { - int pgid = -1; - Channel read_cha = {.fd = stdin_fd, .parent_proc_closable = false, .child_proc_closable = false}; - Channel write_cha = {.fd = stdout_fd, .parent_proc_closable = false, .child_proc_closable = false}; - execute_command_pipeline(root_pl, read_cha, write_cha, true, &pgid, shstate); -} |
