[U-Boot] [PATCH v2 4/5] sandbox/fs: Set correct filetype for unknown filetype

The "hostfs ls" command prefixes each directory entry with either DIR, LNK or " " if it is a directory, symlink resp. regular file, or "???" for any other or unknown type. The latter only works if the type is set correctly, as the entry defaults to OS_FILET_REG and e.g. socket files show up as regular files.
Signed-off-by: Stefan Brüns stefan.bruens@rwth-aachen.de Acked-by: Simon Glass sjg@chromium.org --- arch/sandbox/cpu/os.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index 16af3f5..df2bd4c 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -363,6 +363,8 @@ int os_dirent_ls(const char *dirname, struct os_dirent_node **headp) case DT_LNK: next->type = OS_FILET_LNK; break; + default: + next->type = OS_FILET_UNKNOWN; } next->size = 0; snprintf(fname, len, "%s/%s", dirname, next->name);

On 4 October 2016 at 13:46, Stefan Brüns stefan.bruens@rwth-aachen.de wrote:
The "hostfs ls" command prefixes each directory entry with either DIR, LNK or " " if it is a directory, symlink resp. regular file, or "???" for any other or unknown type. The latter only works if the type is set correctly, as the entry defaults to OS_FILET_REG and e.g. socket files show up as regular files.
Signed-off-by: Stefan Brüns stefan.bruens@rwth-aachen.de Acked-by: Simon Glass sjg@chromium.org
arch/sandbox/cpu/os.c | 2 ++ 1 file changed, 2 insertions(+)
Applied to u-boot-dm, thanks!
participants (2)
-
Simon Glass
-
Stefan Brüns