1
1

Merge pull request #5926 from hjelmn/v4.0.x_need_to_unblock_sigchld_in_some_cases

v4.0.x: Ensure SIGCHLD is unblocked
Этот коммит содержится в:
Howard Pritchard 2018-11-19 13:13:10 -07:00 коммит произвёл GitHub
родитель d6bab4e26d 05e0545581
Коммит 24dae8609e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23

Просмотреть файл

@ -28,6 +28,7 @@
#include "orte/constants.h"
#include <string.h>
#include <signal.h>
#include "opal/class/opal_ring_buffer.h"
#include "orte/mca/mca.h"
@ -225,6 +226,7 @@ static int orte_odls_base_open(mca_base_open_flag_t flags)
int rc, i, rank;
orte_namelist_t *nm;
bool xterm_hold;
sigset_t unblock;
ORTE_CONSTRUCT_LOCK(&orte_odls_globals.lock);
orte_odls_globals.lock.active = false; // start with nobody having the thread
@ -243,6 +245,17 @@ static int orte_odls_base_open(mca_base_open_flag_t flags)
OBJ_CONSTRUCT(&orte_odls_globals.xterm_ranks, opal_list_t);
orte_odls_globals.xtermcmd = NULL;
/* ensure that SIGCHLD is unblocked as we need to capture it */
if (0 != sigemptyset(&unblock)) {
return ORTE_ERROR;
}
if (0 != sigaddset(&unblock, SIGCHLD)) {
return ORTE_ERROR;
}
if (0 != sigprocmask(SIG_UNBLOCK, &unblock, NULL)) {
return ORTE_ERR_NOT_SUPPORTED;
}
/* check if the user requested that we display output in xterms */
if (NULL != orte_xterm) {
/* construct a list of ranks to be displayed */