openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/rsyslog/8.1903.0-r0/rsyslog-8.1903.0/runtime/glbl.c
void glblReportChildProcessExit(const uchar* name, pid_t pid, int status)
{
    DBGPRINTF("waitpid for child %d returned status: %2.2x\n", pid, status);

    if (reportChildProcessExits == REPORT_CHILD_PROCESS_EXITS_NONE ||
        (reportChildProcessExits == REPORT_CHILD_PROCESS_EXITS_ERRORS &&
         WIFEXITED(status) && WEXITSTATUS(status) == 0))
    {
        return;
    }

    if (WIFEXITED(status))
    {
        int severity = WEXITSTATUS(status) == 0 ? LOG_INFO : LOG_WARNING;
        if (name != NULL)
        {
            LogMsg(0, NO_ERRCODE, severity,
                   "program '%s' (pid %d) exited with status %d", name, pid,
                   WEXITSTATUS(status));
        }
        else
        {
            LogMsg(0, NO_ERRCODE, severity,
                   "child process (pid %d) exited with status %d", pid,
                   WEXITSTATUS(status));
        }
    }
    else if (WIFSIGNALED(status))
    {
        if (name != NULL)
        {
            LogMsg(0, NO_ERRCODE, LOG_WARNING,
                   "program '%s' (pid %d) terminated by signal %d", name, pid,
                   WTERMSIG(status));
        }
        else
        {
            LogMsg(0, NO_ERRCODE, LOG_WARNING,
                   "child process (pid %d) terminated by signal %d", pid,
                   WTERMSIG(status));
        }
    }
}
/* logs a message indicating that a child process has terminated.
 * If name != NULL, prints it as the program name.
 */
logs a message indicating that a child process has terminated.
If name != NULL, prints it as the program name.
logs a message indicating that a child process has terminated . If name ! = NULL prints it as the program name .
void glblReportChildProcessExit(const uchar* name, pid_t pid, int status)
{
    DBGPRINTF("waitpid for child %d returned status: %2.2x\n", pid, status);
    if (reportChildProcessExits == REPORT_CHILD_PROCESS_EXITS_NONE ||
        (reportChildProcessExits == REPORT_CHILD_PROCESS_EXITS_ERRORS &&
         WIFEXITED(status) && WEXITSTATUS(status) == 0))
    {
        return;
    }
    if (WIFEXITED(status))
    {
        int severity = WEXITSTATUS(status) == 0 ? LOG_INFO : LOG_WARNING;
        if (name != NULL)
        {
            LogMsg(0, NO_ERRCODE, severity,
                   "program '%s' (pid %d) exited with status %d", name, pid,
                   WEXITSTATUS(status));
        }
        else
        {
            LogMsg(0, NO_ERRCODE, severity,
                   "child process (pid %d) exited with status %d", pid,
                   WEXITSTATUS(status));
        }
    }
    else if (WIFSIGNALED(status))
    {
        if (name != NULL)
        {
            LogMsg(0, NO_ERRCODE, LOG_WARNING,
                   "program '%s' (pid %d) terminated by signal %d", name, pid,
                   WTERMSIG(status));
        }
        else
        {
            LogMsg(0, NO_ERRCODE, LOG_WARNING,
                   "child process (pid %d) terminated by signal %d", pid,
                   WTERMSIG(status));
        }
    }
}
void glblReportChildProcessExit ( const uchar * name , pid_t pid , int status ) { DBGPRINTF ( " \n " , pid , status ) ; if ( reportChildProcessExits == REPORT_CHILD_PROCESS_EXITS_NONE || ( reportChildProcessExits == REPORT_CHILD_PROCESS_EXITS_ERRORS && WIFEXITED ( status ) && WEXITSTATUS ( status ) == 0 ) ) { return ; } if ( WIFEXITED ( status ) ) { int severity = WEXITSTATUS ( status ) == 0 ? LOG_INFO : LOG_WARNING ; if ( name != NULL ) { LogMsg ( 0 , NO_ERRCODE , severity , " " , name , pid , WEXITSTATUS ( status ) ) ; } else { LogMsg ( 0 , NO_ERRCODE , severity , " " , pid , WEXITSTATUS ( status ) ) ; } } else if ( WIFSIGNALED ( status ) ) { if ( name != NULL ) { LogMsg ( 0 , NO_ERRCODE , LOG_WARNING , " " , name , pid , WTERMSIG ( status ) ) ; } else { LogMsg ( 0 , NO_ERRCODE , LOG_WARNING , " " , pid , WTERMSIG ( status ) ) ; } } }
logs a message indicating that a child process has terminated.
logs a message indicating that a child process has terminated .