diff --git a/orte/mca/iof/hnp/iof_hnp_read.c b/orte/mca/iof/hnp/iof_hnp_read.c index f99d578dbd..df07deb8b0 100644 --- a/orte/mca/iof/hnp/iof_hnp_read.c +++ b/orte/mca/iof/hnp/iof_hnp_read.c @@ -47,6 +47,7 @@ static void restart_stdin(int fd, short event, void *cbdata) { if (NULL != mca_iof_hnp_component.stdinev) { + mca_iof_hnp_component.stdinev->active = true; opal_event_add(&(mca_iof_hnp_component.stdinev->ev), 0); } } @@ -179,7 +180,15 @@ void orte_iof_hnp_read_local_handler(int fd, short event, void *cbdata) /* this will also close our stdin file descriptor */ OBJ_RELEASE(mca_iof_hnp_component.stdinev); } else { - ORTE_TIMER_EVENT(0, 10000, restart_stdin); + /* if we are looking at a tty, then we just go ahead and restart the + * read event assuming we are not backgrounded + */ + if (orte_iof_hnp_stdin_check(fd)) { + restart_stdin(fd, 0, NULL); + } else { + /* delay for awhile and then restart */ + ORTE_TIMER_EVENT(0, 10000, restart_stdin); + } } /* nothing more to do */ OPAL_THREAD_UNLOCK(&mca_iof_hnp_component.lock); diff --git a/orte/mca/iof/orted/iof_orted.c b/orte/mca/iof/orted/iof_orted.c index 8aa82d139a..33d2ea6aac 100644 --- a/orte/mca/iof/orted/iof_orted.c +++ b/orte/mca/iof/orted/iof_orted.c @@ -249,6 +249,7 @@ static void stdin_write_handler(int fd, short event, void *cbdata) /* lock us up to protect global operations */ OPAL_THREAD_LOCK(&mca_iof_orted_component.lock); + wev->pending = false; while (NULL != (item = opal_list_remove_first(&wev->outputs))) { output = (orte_iof_write_output_t*)item;