openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/shadow/4.6-r0/shadow-4.6/src/chpasswd.c
static void close_files(void)
{
    if (is_shadow_pwd)
    {
        if (spw_close() == 0)
        {
            fprintf(stderr, _("%s: failure while writing changes to %s\n"),
                    Prog, spw_dbname());
            SYSLOG(
                (LOG_ERR, "failure while writing changes to %s", spw_dbname()));
            fail_exit(1);
        }
        if (spw_unlock() == 0)
        {
            fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname());
            SYSLOG((LOG_ERR, "failed to unlock %s", spw_dbname()));
            /* continue */
        }
        spw_locked = false;
    }

    if (pw_close() == 0)
    {
        fprintf(stderr, _("%s: failure while writing changes to %s\n"), Prog,
                pw_dbname());
        SYSLOG((LOG_ERR, "failure while writing changes to %s", pw_dbname()));
        fail_exit(1);
    }
    if (pw_unlock() == 0)
    {
        fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname());
        SYSLOG((LOG_ERR, "failed to unlock %s", pw_dbname()));
        /* continue */
    }
    pw_locked = false;
}
/*
 * close_files - close and unlock the password databases
 */
close and unlock the password databases
close and unlock the password databases
static void close_files(void)
{
    if (is_shadow_pwd)
    {
        if (spw_close() == 0)
        {
            fprintf(stderr, _("%s: failure while writing changes to %s\n"),
                    Prog, spw_dbname());
            SYSLOG(
                (LOG_ERR, "failure while writing changes to %s", spw_dbname()));
            fail_exit(1);
        }
        if (spw_unlock() == 0)
        {
            fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname());
            SYSLOG((LOG_ERR, "failed to unlock %s", spw_dbname()));
        }
        spw_locked = false;
    }
    if (pw_close() == 0)
    {
        fprintf(stderr, _("%s: failure while writing changes to %s\n"), Prog,
                pw_dbname());
        SYSLOG((LOG_ERR, "failure while writing changes to %s", pw_dbname()));
        fail_exit(1);
    }
    if (pw_unlock() == 0)
    {
        fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname());
        SYSLOG((LOG_ERR, "failed to unlock %s", pw_dbname()));
    }
    pw_locked = false;
}
static void close_files ( void ) { if ( is_shadow_pwd ) { if ( spw_close ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , spw_dbname ( ) ) ; SYSLOG ( ( LOG_ERR , " " , spw_dbname ( ) ) ) ; fail_exit ( 1 ) ; } if ( spw_unlock ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , spw_dbname ( ) ) ; SYSLOG ( ( LOG_ERR , " " , spw_dbname ( ) ) ) ; } spw_locked = false ; } if ( pw_close ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , pw_dbname ( ) ) ; SYSLOG ( ( LOG_ERR , " " , pw_dbname ( ) ) ) ; fail_exit ( 1 ) ; } if ( pw_unlock ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , pw_dbname ( ) ) ; SYSLOG ( ( LOG_ERR , " " , pw_dbname ( ) ) ) ; } pw_locked = false ; }
close_files - close and unlock the password databases
close_files - close and unlock the password databases
/* continue */ /* continue */