diff --git a/orte/mca/iof/hnp/iof_hnp_read.c b/orte/mca/iof/hnp/iof_hnp_read.c index 98adc25479..eb226f0d4e 100644 --- a/orte/mca/iof/hnp/iof_hnp_read.c +++ b/orte/mca/iof/hnp/iof_hnp_read.c @@ -193,13 +193,15 @@ void orte_iof_hnp_read_local_handler(int fd, short event, void *cbdata) (ORTE_IOF_STDOUT & rev->tag) ? "stdout" : ((ORTE_IOF_STDERR & rev->tag) ? "stderr" : "stddiag"), ORTE_NAME_PRINT(&rev->name))); - if ( (0 != numbytes) && (ORTE_IOF_STDOUT & rev->tag) ) { - orte_iof_base_write_output(&rev->name, rev->tag, data, numbytes, &orte_iof_base.iof_write_stdout); - } else { - orte_iof_base_write_output(&rev->name, rev->tag, data, numbytes, &orte_iof_base.iof_write_stderr); - + if (0 != numbytes) { + if (ORTE_IOF_STDOUT & rev->tag) { + orte_iof_base_write_output(&rev->name, rev->tag, data, numbytes, &orte_iof_base.iof_write_stdout); + } else { + orte_iof_base_write_output(&rev->name, rev->tag, data, numbytes, &orte_iof_base.iof_write_stderr); + + } } - + CLEAN_RETURN: /* if we read 0 bytes from the stdout/err/diag, there is * nothing to output - close these file descriptors, diff --git a/orte/mca/iof/tool/iof_tool_receive.c b/orte/mca/iof/tool/iof_tool_receive.c index 5c53ec8d90..6f64b0dcd0 100644 --- a/orte/mca/iof/tool/iof_tool_receive.c +++ b/orte/mca/iof/tool/iof_tool_receive.c @@ -90,11 +90,16 @@ static void process_msg(int fd, short event, void *cbdata) ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), numbytes, ORTE_NAME_PRINT(&origin))); - /* write the output locally */ - if (ORTE_IOF_STDOUT & stream) { - orte_iof_base_write_output(&origin, stream, data, numbytes, &orte_iof_base.iof_write_stdout); - } else { - orte_iof_base_write_output(&origin, stream, data, numbytes, &orte_iof_base.iof_write_stderr); + /* if numbytes is zero, it means that the channel was closed on the far end - for + * now, we just ignore this condition + */ + if (0 < numbytes) { + /* write the output locally */ + if (ORTE_IOF_STDOUT & stream) { + orte_iof_base_write_output(&origin, stream, data, numbytes, &orte_iof_base.iof_write_stdout); + } else { + orte_iof_base_write_output(&origin, stream, data, numbytes, &orte_iof_base.iof_write_stderr); + } } CLEAN_RETURN: