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/tcpsrv.c
static rsRetVal create_tcp_socket(tcpsrv_t* pThis)
{
    DEFiRet;
    rsRetVal localRet;
    tcpLstnPortList_t* pEntry;

    ISOBJ_TYPE_assert(pThis, tcpsrv);

    /* init all configured ports */
    pEntry = pThis->pLstnPorts;
    while (pEntry != NULL)
    {
        localRet = initTCPListener(pThis, pEntry);
        if (localRet != RS_RET_OK)
        {
            LogError(0, localRet,
                     "Could not create tcp listener, ignoring port "
                     "%s bind-address %s.",
                     pEntry->pszPort,
                     (pEntry->pszAddr == NULL) ? "(null)"
                                               : (const char*)pEntry->pszAddr);
        }
        pEntry = pEntry->pNext;
    }

    /* OK, we had success. Now it is also time to
     * initialize our connections
     */
    if (TCPSessTblInit(pThis) != 0)
    {
        /* OK, we are in some trouble - we could not initialize the
         * session table, so we can not continue. We need to free all
         * we have assigned so far, because we can not really use it...
         */
        LogError(0, RS_RET_ERR,
                 "Could not initialize TCP session table, suspending TCP "
                 "message reception.");
        ABORT_FINALIZE(RS_RET_ERR);
    }

finalize_it:
    RETiRet;
}
/* Initialize TCP sockets (for listener) and listens on them */
Initialize TCP sockets (for listener) and listens on them
Initialize TCP sockets ( for listener ) and listens on them
static rsRetVal create_tcp_socket(tcpsrv_t* pThis)
{
    DEFiRet;
    rsRetVal localRet;
    tcpLstnPortList_t* pEntry;
    ISOBJ_TYPE_assert(pThis, tcpsrv);
    pEntry = pThis->pLstnPorts;
    while (pEntry != NULL)
    {
        localRet = initTCPListener(pThis, pEntry);
        if (localRet != RS_RET_OK)
        {
            LogError(0, localRet,
                     "Could not create tcp listener, ignoring port "
                     "%s bind-address %s.",
                     pEntry->pszPort,
                     (pEntry->pszAddr == NULL) ? "(null)"
                                               : (const char*)pEntry->pszAddr);
        }
        pEntry = pEntry->pNext;
    }
    if (TCPSessTblInit(pThis) != 0)
    {
        LogError(0, RS_RET_ERR,
                 "Could not initialize TCP session table, suspending TCP "
                 "message reception.");
        ABORT_FINALIZE(RS_RET_ERR);
    }
finalize_it:
    RETiRet;
}
static rsRetVal create_tcp_socket ( tcpsrv_t * pThis ) { DEFiRet ; rsRetVal localRet ; tcpLstnPortList_t * pEntry ; ISOBJ_TYPE_assert ( pThis , tcpsrv ) ; pEntry = pThis -> pLstnPorts ; while ( pEntry != NULL ) { localRet = initTCPListener ( pThis , pEntry ) ; if ( localRet != RS_RET_OK ) { LogError ( 0 , localRet , " " " " , pEntry -> pszPort , ( pEntry -> pszAddr == NULL ) ? " " : ( const char * ) pEntry -> pszAddr ) ; } pEntry = pEntry -> pNext ; } if ( TCPSessTblInit ( pThis ) != 0 ) { LogError ( 0 , RS_RET_ERR , " " " " ) ; ABORT_FINALIZE ( RS_RET_ERR ) ; } finalize_it : RETiRet ; }
Initialize TCP sockets (for listener) and listens on them
Initialize TCP sockets ( for listener ) and listens on them
/* init all configured ports */ /* OK, we had success. Now it is also time to
     * initialize our connections
     */ /* OK, we are in some trouble - we could not initialize the
         * session table, so we can not continue. We need to free all
         * we have assigned so far, because we can not really use it...
         */