]> git.sur5r.net Git - u-boot/commitdiff
sandbox/fs: Set correct filetype for unknown filetype
authorStefan Brüns <stefan.bruens@rwth-aachen.de>
Tue, 4 Oct 2016 19:46:35 +0000 (21:46 +0200)
committerSimon Glass <sjg@chromium.org>
Tue, 11 Oct 2016 16:17:08 +0000 (10:17 -0600)
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

index 47622a599cad84ff15b7276fdf17a62e0753d879..35ea00ce3ca0699d478b206ed50a9411665ef495 100644 (file)
@@ -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);