X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=fs%2Fsandbox%2Fsandboxfs.c;h=ca8026133708d2e7083a004e92a952f19c6a66f9;hb=a9bdd67653c026d3f568375ca8e48fb5014c62c9;hp=a920bc087712ff289c65eec948f0f234229f9f5c;hpb=21008ad6384170767041f1608975473c5ffa7fc7;p=u-boot diff --git a/fs/sandbox/sandboxfs.c b/fs/sandbox/sandboxfs.c index a920bc0877..ca80261337 100644 --- a/fs/sandbox/sandboxfs.c +++ b/fs/sandbox/sandboxfs.c @@ -8,9 +8,13 @@ #include #include -int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info) +int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) { - return 0; + /* + * Only accept a NULL struct blk_desc for the sandbox, which is when + * hostfs interface is used + */ + return rbdd != NULL; } int sandbox_fs_read_at(const char *filename, loff_t pos, void *buffer, @@ -84,14 +88,16 @@ int sandbox_fs_ls(const char *dirname) ret = os_dirent_ls(dirname, &head); if (ret) - return ret; + goto out; for (node = head; node; node = node->next) { printf("%s %10lu %s\n", os_dirent_get_typename(node->type), node->size, node->name); } +out: + os_dirent_free(head); - return 0; + return ret; } int sandbox_fs_exists(const char *filename)