From 2f159402d9ab0dc642759d9eab3b002cde33064d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20Br=C3=BCns?= Date: Tue, 4 Oct 2016 21:46:35 +0200 Subject: [PATCH] sandbox/fs: Set correct filetype for unknown filetype MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Acked-by: Simon Glass --- 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 47622a599c..35ea00ce3c 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -366,6 +366,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); -- 2.39.5