Skip to content
Snippets Groups Projects
Commit 2f159402 authored by Stefan Brüns's avatar Stefan Brüns Committed by Simon Glass
Browse files

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: default avatarStefan Brüns <stefan.bruens@rwth-aachen.de>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
parent 80793db9
No related branches found
No related tags found
No related merge requests found
...@@ -366,6 +366,8 @@ int os_dirent_ls(const char *dirname, struct os_dirent_node **headp) ...@@ -366,6 +366,8 @@ int os_dirent_ls(const char *dirname, struct os_dirent_node **headp)
case DT_LNK: case DT_LNK:
next->type = OS_FILET_LNK; next->type = OS_FILET_LNK;
break; break;
default:
next->type = OS_FILET_UNKNOWN;
} }
next->size = 0; next->size = 0;
snprintf(fname, len, "%s/%s", dirname, next->name); snprintf(fname, len, "%s/%s", dirname, next->name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment