openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/nss-pam-ldapd/0.9.8-r0/nss-pam-ldapd-0.9.8/nslcd/log.c
void log_newsession(void)
{
#ifndef TLS
    char *sessionid, *requestid;
    pthread_once(&tls_init_once, tls_init_keys);
    sessionid = pthread_getspecific(sessionid_key);
    requestid = pthread_getspecific(requestid_key);
#endif /* no TLS */
    /* ensure that sessionid can hold a string */
    if (sessionid == NULL)
    {
        sessionid = (char*)malloc(7);
        if (sessionid == NULL)
        {
            fprintf(stderr, "malloc() failed: %s", strerror(errno));
            return; /* silently fail */
        }
#ifndef TLS
        pthread_setspecific(sessionid_key, sessionid);
#endif /* no TLS */
    }
    sprintf(sessionid, "%06x", (int)(rand() & 0xffffff));
    /* set the request id to empty */
    if (requestid != NULL)
        requestid[0] = '\0';
}
/* indicate that a session id should be included in the output
   and set it to a new value */
indicate that a session id should be included in the output
and set it to a new value
indicate that a session id should be included in the output and set it to a new value
void log_newsession(void)
{
#ifndef TLS
    char *sessionid, *requestid;
    pthread_once(&tls_init_once, tls_init_keys);
    sessionid = pthread_getspecific(sessionid_key);
    requestid = pthread_getspecific(requestid_key);
#endif 
    if (sessionid == NULL)
    {
        sessionid = (char*)malloc(7);
        if (sessionid == NULL)
        {
            fprintf(stderr, "malloc() failed: %s", strerror(errno));
            return; 
        }
#ifndef TLS
        pthread_setspecific(sessionid_key, sessionid);
#endif 
    }
    sprintf(sessionid, "%06x", (int)(rand() & 0xffffff));
    if (requestid != NULL)
        requestid[0] = '\0';
}
void log_newsession ( void ) { #ifndef TLS char * sessionid , * requestid ; pthread_once ( & tls_init_once , tls_init_keys ) ; sessionid = pthread_getspecific ( sessionid_key ) ; requestid = pthread_getspecific ( requestid_key ) ; #endif if ( sessionid == NULL ) { sessionid = ( char * ) malloc ( 7 ) ; if ( sessionid == NULL ) { fprintf ( stderr , " " , strerror ( errno ) ) ; return ; } #ifndef TLS pthread_setspecific ( sessionid_key , sessionid ) ; #endif } sprintf ( sessionid , " " , ( int ) ( rand ( ) & 0xffffff ) ) ; if ( requestid != NULL ) requestid [ 0 ] = ' \0 ' ; }
indicate that a session id should be included in the output
and set it to a new value
indicate that a session id should be included in the output and set it to a new value
/* no TLS */ /* ensure that sessionid can hold a string */ /* silently fail */ /* no TLS */ /* set the request id to empty */