openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/util-linux/2.33.2-r0/util-linux-2.33.2/login-utils/sulogin-consoles.c
static dev_t devattr(const char* const tty)
{
    dev_t dev = 0;
    char *path, *value;

    if (!tty || !*tty)
        return 0;
    if (asprintf(&path, "/sys/class/tty/%s/dev", tty) < 0)
        return 0;

    value = oneline(path);
    if (value)
    {
        unsigned int maj, min;

        if (sscanf(value, "%u:%u", &maj, &min) == 2)
            dev = makedev(maj, min);
        free(value);
    }

    free(path);
    return dev;
}
/*
 * Read and determine device attribute for tty below
 * /sys/class/tty.
 */
Read and determine device attribute for tty below
/sys/class/tty.
Read and determine device attribute for tty below / sys / class / tty .
static dev_t devattr(const char* const tty)
{
    dev_t dev = 0;
    char *path, *value;
    if (!tty || !*tty)
        return 0;
    if (asprintf(&path, "/sys/class/tty/%s/dev", tty) < 0)
        return 0;
    value = oneline(path);
    if (value)
    {
        unsigned int maj, min;
        if (sscanf(value, "%u:%u", &maj, &min) == 2)
            dev = makedev(maj, min);
        free(value);
    }
    free(path);
    return dev;
}
static dev_t devattr ( const char * const tty ) { dev_t dev = 0 ; char * path , * value ; if ( ! tty || ! * tty ) return 0 ; if ( asprintf ( & path , " " , tty ) < 0 ) return 0 ; value = oneline ( path ) ; if ( value ) { unsigned int maj , min ; if ( sscanf ( value , " " , & maj , & min ) == 2 ) dev = makedev ( maj , min ) ; free ( value ) ; } free ( path ) ; return dev ; }
Read and determine device attribute for tty below
 /sys/class/tty.
Read and determine device attribute for tty below / sys / class / tty .