src/axl_async_bbapi.c
/* Return the filesystem magic value for a given file */
Return the filesystem magic value for a given file
Return the filesystem magic value for a given file
static __fsword_t axl_get_fs_magic(char* path)
{
    struct statfs st;
    int rc = statfs(path, &st);
    if (rc != 0) {
        char* dir = strdup(path);
        if (! dir) {
            return 0;
        }
        path = dirname(dir);
        rc = statfs(path, &st);
        if (rc != 0) {
            free(dir);
            return 0;
        }
        free(dir);
    }
    return st.f_type;
}
static __fsword_t axl_get_fs_magic ( char * path ) { struct statfs st ; int rc = statfs ( path , & st ) ; if ( rc != 0 ) { char * dir = strdup ( path ) ; if ( ! dir ) { return 0 ; } path = dirname ( dir ) ; rc = statfs ( path , & st ) ; if ( rc != 0 ) { free ( dir ) ; return 0 ; } free ( dir ) ; } return st . f_type ; }
Return the filesystem magic value for a given file
Return the filesystem magic value for a given file
/* Stat the path itself */ /* Couldn't statfs the path, which could be normal if the path is the
         * destination path.  Next, try stating the underlying path's directory
         * (which should exist for both the source and destination), for the
         * FS type. */