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/chgpasswd.c
static void close_files(void)
{
#ifdef SHADOWGRP
    if (is_shadow_grp)
    {
        if (sgr_close() == 0)
        {
            fprintf(stderr, _("%s: failure while writing changes to %s\n"),
                    Prog, sgr_dbname());
            SYSLOG(
                (LOG_ERR, "failure while writing changes to %s", sgr_dbname()));
            fail_exit(1);
        }
        if (sgr_unlock() == 0)
        {
            fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname());
            SYSLOG((LOG_ERR, "failed to unlock %s", sgr_dbname()));
            /* continue */
        }
        sgr_locked = false;
    }
#endif

    if (gr_close() == 0)
    {
        fprintf(stderr, _("%s: failure while writing changes to %s\n"), Prog,
                gr_dbname());
        SYSLOG((LOG_ERR, "failure while writing changes to %s", gr_dbname()));
        fail_exit(1);
    }
    if (gr_unlock() == 0)
    {
        fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname());
        SYSLOG((LOG_ERR, "failed to unlock %s", gr_dbname()));
        /* continue */
    }
    gr_locked = false;
}
/*
 * close_files - close and unlock the group databases
 */
close and unlock the group databases
close and unlock the group databases
static void close_files(void)
{
#ifdef SHADOWGRP
    if (is_shadow_grp)
    {
        if (sgr_close() == 0)
        {
            fprintf(stderr, _("%s: failure while writing changes to %s\n"),
                    Prog, sgr_dbname());
            SYSLOG(
                (LOG_ERR, "failure while writing changes to %s", sgr_dbname()));
            fail_exit(1);
        }
        if (sgr_unlock() == 0)
        {
            fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname());
            SYSLOG((LOG_ERR, "failed to unlock %s", sgr_dbname()));
        }
        sgr_locked = false;
    }
#endif
    if (gr_close() == 0)
    {
        fprintf(stderr, _("%s: failure while writing changes to %s\n"), Prog,
                gr_dbname());
        SYSLOG((LOG_ERR, "failure while writing changes to %s", gr_dbname()));
        fail_exit(1);
    }
    if (gr_unlock() == 0)
    {
        fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname());
        SYSLOG((LOG_ERR, "failed to unlock %s", gr_dbname()));
    }
    gr_locked = false;
}
static void close_files ( void ) { #ifdef SHADOWGRP if ( is_shadow_grp ) { if ( sgr_close ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , sgr_dbname ( ) ) ; SYSLOG ( ( LOG_ERR , " " , sgr_dbname ( ) ) ) ; fail_exit ( 1 ) ; } if ( sgr_unlock ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , sgr_dbname ( ) ) ; SYSLOG ( ( LOG_ERR , " " , sgr_dbname ( ) ) ) ; } sgr_locked = false ; } #endif if ( gr_close ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , gr_dbname ( ) ) ; SYSLOG ( ( LOG_ERR , " " , gr_dbname ( ) ) ) ; fail_exit ( 1 ) ; } if ( gr_unlock ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , gr_dbname ( ) ) ; SYSLOG ( ( LOG_ERR , " " , gr_dbname ( ) ) ) ; } gr_locked = false ; }
close_files - close and unlock the group databases
close_files - close and unlock the group databases
/* continue */ /* continue */