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/nsswitch.c
void nsswitch_check_reload(void)
{
    struct stat buf;
    time_t t;
    if ((cached_shadow_uses_ldap != CACHED_UNKNOWN) &&
        ((t = time(NULL)) > (cached_shadow_lastcheck + CACHED_SHADOW_TIMEOUT)))
    {
        cached_shadow_lastcheck = t;
        if (stat(NSSWITCH_FILE, &buf))
        {
            log_log(LOG_ERR, "stat(%s) failed: %s", NSSWITCH_FILE,
                    strerror(errno));
            /* trigger a recheck anyway */
            cached_shadow_uses_ldap = CACHED_UNKNOWN;
            return;
        }
        /* trigger a recheck if file changed */
        if (buf.st_mtime != nsswitch_mtime)
        {
            nsswitch_mtime = buf.st_mtime;
            cached_shadow_uses_ldap = CACHED_UNKNOWN;
        }
    }
}
/* check whether /etc/nsswitch.conf should be related to update
   cached_shadow_uses_ldap */
check whether /etc/nsswitch.conf should be related to update
cached_shadow_uses_ldap
check whether / etc / nsswitch . conf should be related to update cached_shadow_uses_ldap
void nsswitch_check_reload(void)
{
    struct stat buf;
    time_t t;
    if ((cached_shadow_uses_ldap != CACHED_UNKNOWN) &&
        ((t = time(NULL)) > (cached_shadow_lastcheck + CACHED_SHADOW_TIMEOUT)))
    {
        cached_shadow_lastcheck = t;
        if (stat(NSSWITCH_FILE, &buf))
        {
            log_log(LOG_ERR, "stat(%s) failed: %s", NSSWITCH_FILE,
                    strerror(errno));
            cached_shadow_uses_ldap = CACHED_UNKNOWN;
            return;
        }
        if (buf.st_mtime != nsswitch_mtime)
        {
            nsswitch_mtime = buf.st_mtime;
            cached_shadow_uses_ldap = CACHED_UNKNOWN;
        }
    }
}
void nsswitch_check_reload ( void ) { struct stat buf ; time_t t ; if ( ( cached_shadow_uses_ldap != CACHED_UNKNOWN ) && ( ( t = time ( NULL ) ) > ( cached_shadow_lastcheck + CACHED_SHADOW_TIMEOUT ) ) ) { cached_shadow_lastcheck = t ; if ( stat ( NSSWITCH_FILE , & buf ) ) { log_log ( LOG_ERR , " " , NSSWITCH_FILE , strerror ( errno ) ) ; cached_shadow_uses_ldap = CACHED_UNKNOWN ; return ; } if ( buf . st_mtime != nsswitch_mtime ) { nsswitch_mtime = buf . st_mtime ; cached_shadow_uses_ldap = CACHED_UNKNOWN ; } } }
check whether /etc/nsswitch.conf should be related to update
cached_shadow_uses_ldap
check whether / etc / nsswitch . conf should be related to update cached_shadow_uses_ldap
/* trigger a recheck anyway */ /* trigger a recheck if file changed */