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/groupmod.c
static void lock_files(void)
{
    if (gr_lock() == 0)
    {
        fprintf(stderr, _("%s: cannot lock %s; try again later.\n"), Prog,
                gr_dbname());
        exit(E_GRP_UPDATE);
    }
    add_cleanup(cleanup_unlock_group, NULL);

#ifdef SHADOWGRP
    if (is_shadow_grp && (pflg || nflg))
    {
        if (sgr_lock() == 0)
        {
            fprintf(stderr, _("%s: cannot lock %s; try again later.\n"), Prog,
                    sgr_dbname());
            exit(E_GRP_UPDATE);
        }
        add_cleanup(cleanup_unlock_gshadow, NULL);
    }
#endif

    if (gflg)
    {
        if (pw_lock() == 0)
        {
            fprintf(stderr, _("%s: cannot lock %s; try again later.\n"), Prog,
                    pw_dbname());
            exit(E_GRP_UPDATE);
        }
        add_cleanup(cleanup_unlock_passwd, NULL);
    }
}
/*
 * lock_files - lock the accounts databases
 *
 *	lock_files() locks the group, gshadow, and passwd databases.
 */
lock the accounts databases
lock_files() locks the group, gshadow, and passwd databases.
lock the accounts databases lock_files () locks the group gshadow and passwd databases .
static void lock_files(void)
{
    if (gr_lock() == 0)
    {
        fprintf(stderr, _("%s: cannot lock %s; try again later.\n"), Prog,
                gr_dbname());
        exit(E_GRP_UPDATE);
    }
    add_cleanup(cleanup_unlock_group, NULL);
#ifdef SHADOWGRP
    if (is_shadow_grp && (pflg || nflg))
    {
        if (sgr_lock() == 0)
        {
            fprintf(stderr, _("%s: cannot lock %s; try again later.\n"), Prog,
                    sgr_dbname());
            exit(E_GRP_UPDATE);
        }
        add_cleanup(cleanup_unlock_gshadow, NULL);
    }
#endif
    if (gflg)
    {
        if (pw_lock() == 0)
        {
            fprintf(stderr, _("%s: cannot lock %s; try again later.\n"), Prog,
                    pw_dbname());
            exit(E_GRP_UPDATE);
        }
        add_cleanup(cleanup_unlock_passwd, NULL);
    }
}
static void lock_files ( void ) { if ( gr_lock ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , gr_dbname ( ) ) ; exit ( E_GRP_UPDATE ) ; } add_cleanup ( cleanup_unlock_group , NULL ) ; #ifdef SHADOWGRP if ( is_shadow_grp && ( pflg || nflg ) ) { if ( sgr_lock ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , sgr_dbname ( ) ) ; exit ( E_GRP_UPDATE ) ; } add_cleanup ( cleanup_unlock_gshadow , NULL ) ; } #endif if ( gflg ) { if ( pw_lock ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , pw_dbname ( ) ) ; exit ( E_GRP_UPDATE ) ; } add_cleanup ( cleanup_unlock_passwd , NULL ) ; } }
lock_files - lock the accounts databases
      lock_files() locks the group, gshadow, and passwd databases.
lock_files - lock the accounts databases lock_files () locks the group gshadow and passwd databases .