diff options
Diffstat (limited to 'lib/command_execute.c')
-rw-r--r-- | lib/command_execute.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/command_execute.c b/lib/command_execute.c index 32698d94..cc457ba3 100644 --- a/lib/command_execute.c +++ b/lib/command_execute.c @@ -473,13 +473,13 @@ cmd_open_pipes(vty vty) cmd_parsed parsed = exec->parsed ; cmd_return_code_t ret ; vty_io vio ; - + bool sync_depth ; VTY_LOCK() ; vio = vty->vio ; ret = CMD_SUCCESS ; - uty_cmd_depth_mark(vio) ; /* about to push vin and/or vout */ + sync_depth = false ; /* assuming no in pipe */ /* Deal with any in pipe stuff */ if ((parsed->parts & cmd_part_in_pipe) != 0) @@ -499,6 +499,8 @@ cmd_open_pipes(vty vty) zabort("invalid in pipe state") ; qs_free(args) ; + + sync_depth = true ; } ; /* Deal with any out pipe stuff */ @@ -511,15 +513,18 @@ cmd_open_pipes(vty vty) if ((parsed->out_pipe & cmd_pipe_file) != 0) ret = uty_cmd_open_out_pipe_file(vio, exec->context, args, - parsed->out_pipe) ; + parsed->out_pipe) ; else if ((parsed->out_pipe & cmd_pipe_shell) != 0) ret = uty_cmd_open_out_pipe_shell(vio, exec->context, args, - parsed->out_pipe) ; + parsed->out_pipe) ; else if ((parsed->out_pipe & cmd_pipe_dev_null) != 0) ret = uty_cmd_open_out_dev_null(vio) ; else zabort("invalid out pipe state") ; + if (sync_depth && (ret == CMD_SUCCESS)) + uty_vout_sync_depth(vio) ; + qs_free(args) ; } ; |