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/misc-utils/findmnt-verify.c
static int verify_source(struct verify_context* vfy)
{
    const char* src = mnt_fs_get_srcpath(vfy->fs);
    char *t = NULL, *v = NULL;
    struct stat sb;
    int isbind, rc = 0;

    /* source is NAME=value tag */
    if (!src)
    {
        const char *tag = NULL, *val = NULL;

        if (mnt_fs_get_tag(vfy->fs, &tag, &val) != 0)
            return verify_err(vfy, _("undefined source (fs_spec)"));

        src = verify_tag(vfy, tag, val);
        if (!src)
            goto done;

        /* blkid is able to parse it, but libmount does not see it as a tag --
         * it means unsupported tag */
    }
    else if (blkid_parse_tag_string(src, &t, &v) == 0 && stat(src, &sb) != 0)
    {
        rc = verify_err(vfy, _("unsupported source tag: %s"), src);
        goto done;
    }
    isbind = mnt_fs_get_option(vfy->fs, "bind", NULL, NULL) == 0;

    /* source is path */
    if (mnt_fs_is_pseudofs(vfy->fs) || mnt_fs_is_netfs(vfy->fs))
        verify_ok(vfy, _("do not check %s source (pseudo/net)"), src);

    else if (stat(src, &sb) != 0)
        verify_warn(vfy, _("unreachable source: %s: %m"), src);

    else if ((S_ISDIR(sb.st_mode) || S_ISREG(sb.st_mode)) && !isbind)
        verify_warn(
            vfy, _("non-bind mount source %s is a directory or regular file"),
            src);

    else if (!S_ISBLK(sb.st_mode) && !isbind)
        verify_warn(vfy, _("source %s is not a block device"), src);
    else
        verify_ok(vfy, _("source %s exists"), src);
done:
    free(t);
    free(v);
    return rc;
}
/* Note that mount source is very FS specific and we should not
 * interpret unreachable source as error. The exception is only
 * NAME=value, this has to be convertible to device name.
 */
Note that mount source is very FS specific and we should not
interpret unreachable source as error. The exception is only
NAME=value, this has to be convertible to device name.
Note that mount source is very FS specific and we should not interpret unreachable source as error . The exception is only NAME = value this has to be convertible to device name .
static int verify_source(struct verify_context* vfy)
{
    const char* src = mnt_fs_get_srcpath(vfy->fs);
    char *t = NULL, *v = NULL;
    struct stat sb;
    int isbind, rc = 0;
    if (!src)
    {
        const char *tag = NULL, *val = NULL;
        if (mnt_fs_get_tag(vfy->fs, &tag, &val) != 0)
            return verify_err(vfy, _("undefined source (fs_spec)"));
        src = verify_tag(vfy, tag, val);
        if (!src)
            goto done;
    }
    else if (blkid_parse_tag_string(src, &t, &v) == 0 && stat(src, &sb) != 0)
    {
        rc = verify_err(vfy, _("unsupported source tag: %s"), src);
        goto done;
    }
    isbind = mnt_fs_get_option(vfy->fs, "bind", NULL, NULL) == 0;
    if (mnt_fs_is_pseudofs(vfy->fs) || mnt_fs_is_netfs(vfy->fs))
        verify_ok(vfy, _("do not check %s source (pseudo/net)"), src);
    else if (stat(src, &sb) != 0)
        verify_warn(vfy, _("unreachable source: %s: %m"), src);
    else if ((S_ISDIR(sb.st_mode) || S_ISREG(sb.st_mode)) && !isbind)
        verify_warn(
            vfy, _("non-bind mount source %s is a directory or regular file"),
            src);
    else if (!S_ISBLK(sb.st_mode) && !isbind)
        verify_warn(vfy, _("source %s is not a block device"), src);
    else
        verify_ok(vfy, _("source %s exists"), src);
done:
    free(t);
    free(v);
    return rc;
}
static int verify_source ( struct verify_context * vfy ) { const char * src = mnt_fs_get_srcpath ( vfy -> fs ) ; char * t = NULL , * v = NULL ; struct stat sb ; int isbind , rc = 0 ; if ( ! src ) { const char * tag = NULL , * val = NULL ; if ( mnt_fs_get_tag ( vfy -> fs , & tag , & val ) != 0 ) return verify_err ( vfy , _ ( " " ) ) ; src = verify_tag ( vfy , tag , val ) ; if ( ! src ) goto done ; } else if ( blkid_parse_tag_string ( src , & t , & v ) == 0 && stat ( src , & sb ) != 0 ) { rc = verify_err ( vfy , _ ( " " ) , src ) ; goto done ; } isbind = mnt_fs_get_option ( vfy -> fs , " " , NULL , NULL ) == 0 ; if ( mnt_fs_is_pseudofs ( vfy -> fs ) || mnt_fs_is_netfs ( vfy -> fs ) ) verify_ok ( vfy , _ ( " " ) , src ) ; else if ( stat ( src , & sb ) != 0 ) verify_warn ( vfy , _ ( " " ) , src ) ; else if ( ( S_ISDIR ( sb . st_mode ) || S_ISREG ( sb . st_mode ) ) && ! isbind ) verify_warn ( vfy , _ ( " " ) , src ) ; else if ( ! S_ISBLK ( sb . st_mode ) && ! isbind ) verify_warn ( vfy , _ ( " " ) , src ) ; else verify_ok ( vfy , _ ( " " ) , src ) ; done : free ( t ) ; free ( v ) ; return rc ; }
Note that mount source is very FS specific and we should not
 interpret unreachable source as error.
Note that mount source is very FS specific and we should not interpret unreachable source as error .
/* source is NAME=value tag */ /* blkid is able to parse it, but libmount does not see it as a tag --
         * it means unsupported tag */ /* source is path */