src/mca/odls/default/odls_default_module.c
/**
 * Send a signal to a pid.  Note that if we get an error, we set the
 * return value and let the upper layer print out the message.
 */
Send a signal to a pid.  Note that if we get an error, we set the
return value and let the upper layer print out the message.
Send a signal to a pid . Note that if we get an error we set the return value and let the upper layer print out the message .
static int send_signal(pid_t pd, int signal)
{
    int rc = PRTE_SUCCESS;
    pid_t pid;
    if (prte_odls_globals.signal_direct_children_only) {
        pid = pd;
    } else {
#if HAVE_SETPGID
        pid = -pd;
#else
        pid = pd;
#endif
    }
    PRTE_OUTPUT_VERBOSE((1, prte_odls_base_framework.framework_output,
                         "%s sending signal %d to pid %ld", PRTE_NAME_PRINT(PRTE_PROC_MY_NAME),
                         signal, (long) pid));
    if (kill(pid, signal) != 0) {
        switch (errno) {
        case EINVAL:
            rc = PRTE_ERR_BAD_PARAM;
            break;
        case ESRCH:
            break;
        case EPERM:
            rc = PRTE_ERR_PERM;
            break;
        default:
            rc = PRTE_ERROR;
        }
    }
    return rc;
}
static int send_signal ( pid_t pd , int signal ) { int rc = PRTE_SUCCESS ; pid_t pid ; if ( prte_odls_globals . signal_direct_children_only ) { pid = pd ; } else { #if HAVE_SETPGID pid = - pd ; #else pid = pd ; #endif } PRTE_OUTPUT_VERBOSE ( ( 1 , prte_odls_base_framework . framework_output , " " , PRTE_NAME_PRINT ( PRTE_PROC_MY_NAME ) , signal , ( long ) pid ) ) ; if ( kill ( pid , signal ) != 0 ) { switch ( errno ) { case EINVAL : rc = PRTE_ERR_BAD_PARAM ; break ; case ESRCH : break ; case EPERM : rc = PRTE_ERR_PERM ; break ; default : rc = PRTE_ERROR ; } } return rc ; }
Send a signal to a pid.
Send a signal to a pid .
/* send to the process group so that any children of our children
         * also receive the signal*/ /* This case can occur when we deliver a signal to a
               process that is no longer there.  This can happen if
               we deliver a signal while the job is shutting down.
               This does not indicate a real problem, so just
               ignore the error.  */