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/groupadd.c
static void check_flags(void)
{
    /* -o does not make sense without -g */
    if (oflg && !gflg)
    {
        usage(E_USAGE);
    }

    check_new_name();

    /*
     * Check if the group already exist.
     */
    /* local, no need for xgetgrnam */
    if (prefix_getgrnam(group_name) != NULL)
    {
        /* The group already exist */
        if (fflg)
        {
            /* OK, no need to do anything */
            exit(E_SUCCESS);
        }
        fprintf(stderr, _("%s: group '%s' already exists\n"), Prog, group_name);
        exit(E_NAME_IN_USE);
    }

    if (gflg && (prefix_getgrgid(group_id) != NULL))
    {
        /* A GID was specified, and a group already exist with that GID
         *  - either we will use this GID anyway (-o)
         *  - either we ignore the specified GID and
         *    we will use another one (-f)
         *  - either it is a failure
         */
        if (oflg)
        {
            /* Continue with this GID */
        }
        else if (fflg)
        {
            /* Turn off -g, we can use any GID */
            gflg = false;
        }
        else
        {
            fprintf(stderr, _("%s: GID '%lu' already exists\n"), Prog,
                    (unsigned long int)group_id);
            exit(E_GID_IN_USE);
        }
    }
}
/*
 * check_flags - check flags and parameters consistency
 *
 *	It will not return if an error is encountered.
 */
check flags and parameters consistency
It will not return if an error is encountered.
check flags and parameters consistency It will not return if an error is encountered .
static void check_flags(void)
{
    if (oflg && !gflg)
    {
        usage(E_USAGE);
    }
    check_new_name();
    if (prefix_getgrnam(group_name) != NULL)
    {
        if (fflg)
        {
            exit(E_SUCCESS);
        }
        fprintf(stderr, _("%s: group '%s' already exists\n"), Prog, group_name);
        exit(E_NAME_IN_USE);
    }
    if (gflg && (prefix_getgrgid(group_id) != NULL))
    {
        if (oflg)
        {
        }
        else if (fflg)
        {
            gflg = false;
        }
        else
        {
            fprintf(stderr, _("%s: GID '%lu' already exists\n"), Prog,
                    (unsigned long int)group_id);
            exit(E_GID_IN_USE);
        }
    }
}
static void check_flags ( void ) { if ( oflg && ! gflg ) { usage ( E_USAGE ) ; } check_new_name ( ) ; if ( prefix_getgrnam ( group_name ) != NULL ) { if ( fflg ) { exit ( E_SUCCESS ) ; } fprintf ( stderr , _ ( " \n " ) , Prog , group_name ) ; exit ( E_NAME_IN_USE ) ; } if ( gflg && ( prefix_getgrgid ( group_id ) != NULL ) ) { if ( oflg ) { } else if ( fflg ) { gflg = false ; } else { fprintf ( stderr , _ ( " \n " ) , Prog , ( unsigned long int ) group_id ) ; exit ( E_GID_IN_USE ) ; } } }
check_flags - check flags and parameters consistency
      It will not return if an error is encountered.
check_flags - check flags and parameters consistency It will not return if an error is encountered .
/* -o does not make sense without -g */ /*
     * Check if the group already exist.
     */ /* local, no need for xgetgrnam */ /* The group already exist */ /* OK, no need to do anything */ /* A GID was specified, and a group already exist with that GID
         *  - either we will use this GID anyway (-o)
         *  - either we ignore the specified GID and
         *    we will use another one (-f)
         *  - either it is a failure
         */ /* Continue with this GID */ /* Turn off -g, we can use any GID */