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_setrequest(const char* format, ...)
{
    va_list ap;
#ifndef TLS
    char* requestid;
    pthread_once(&tls_init_once, tls_init_keys);
    requestid = pthread_getspecific(requestid_key);
#endif /* no TLS */
    /* ensure that requestid can hold a string */
    if (requestid == NULL)
    {
        requestid = (char*)malloc(MAX_REQUESTID_LENGTH);
        if (requestid == NULL)
        {
            fprintf(stderr, "malloc() failed: %s", strerror(errno));
            return; /* silently fail */
        }
#ifndef TLS
        pthread_setspecific(requestid_key, requestid);
#endif /* no TLS */
    }
    /* make the message */
    va_start(ap, format);
    vsnprintf(requestid, MAX_REQUESTID_LENGTH, format, ap);
    requestid[MAX_REQUESTID_LENGTH - 1] = '\0';
    va_end(ap);
}
/* indicate that a request identifier should be included in the output
   from this point on, until log_newsession() is called */
indicate that a request identifier should be included in the output
from this point on, until log_newsession() is called
indicate that a request identifier should be included in the output from this point on until log_newsession () is called
void log_setrequest(const char* format, ...)
{
    va_list ap;
#ifndef TLS
    char* requestid;
    pthread_once(&tls_init_once, tls_init_keys);
    requestid = pthread_getspecific(requestid_key);
#endif 
    if (requestid == NULL)
    {
        requestid = (char*)malloc(MAX_REQUESTID_LENGTH);
        if (requestid == NULL)
        {
            fprintf(stderr, "malloc() failed: %s", strerror(errno));
            return; 
        }
#ifndef TLS
        pthread_setspecific(requestid_key, requestid);
#endif 
    }
    va_start(ap, format);
    vsnprintf(requestid, MAX_REQUESTID_LENGTH, format, ap);
    requestid[MAX_REQUESTID_LENGTH - 1] = '\0';
    va_end(ap);
}
void log_setrequest ( const char * format , ... ) { va_list ap ; #ifndef TLS char * requestid ; pthread_once ( & tls_init_once , tls_init_keys ) ; requestid = pthread_getspecific ( requestid_key ) ; #endif if ( requestid == NULL ) { requestid = ( char * ) malloc ( MAX_REQUESTID_LENGTH ) ; if ( requestid == NULL ) { fprintf ( stderr , " " , strerror ( errno ) ) ; return ; } #ifndef TLS pthread_setspecific ( requestid_key , requestid ) ; #endif } va_start ( ap , format ) ; vsnprintf ( requestid , MAX_REQUESTID_LENGTH , format , ap ) ; requestid [ MAX_REQUESTID_LENGTH - 1 ] = ' \0 ' ; va_end ( ap ) ; }
indicate that a request identifier should be included in the output
from this point on, until log_newsession() is called
indicate that a request identifier should be included in the output from this point on until log_newsession () is called
/* no TLS */ /* ensure that requestid can hold a string */ /* silently fail */ /* no TLS */ /* make the message */