aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_execution.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-13 03:57:59 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-13 03:57:59 -0800
commit6fc1d7dc7705c9e6376ae220f1f7afa85434dc26 (patch)
treebfaa8dca0f6df156cd84af606608afe96ae0a6f7 /parse_execution.cpp
parentd9056081e78cc847574589d8ca31f2e25a82b6f5 (diff)
Further cleanup and improvements to error messages
Diffstat (limited to 'parse_execution.cpp')
-rw-r--r--parse_execution.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/parse_execution.cpp b/parse_execution.cpp
index cc0a4ddd..d30f3b99 100644
--- a/parse_execution.cpp
+++ b/parse_execution.cpp
@@ -1188,7 +1188,13 @@ parse_execution_result_t parse_execution_context_t::populate_job_from_job_node(j
/* Handle the pipe, whose fd may not be the obvious stdout */
const parse_node_t &pipe_node = *get_child(*job_cont, 0, parse_token_type_pipe);
- processes.back()->pipe_write_fd = fd_redirected_by_pipe(get_source(pipe_node));
+ int pipe_write_fd = fd_redirected_by_pipe(get_source(pipe_node));
+ if (pipe_write_fd == -1)
+ {
+ result = report_error(pipe_node, ILLEGAL_FD_ERR_MSG, get_source(pipe_node).c_str());
+ break;
+ }
+ processes.back()->pipe_write_fd = pipe_write_fd;
/* Get the statement node and make a process from it */
const parse_node_t *statement_node = get_child(*job_cont, 1, symbol_statement);