浏览代码

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>
Stefan Brüns 8 年之前
父节点
当前提交
2f159402d9
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      arch/sandbox/cpu/os.c

+ 2 - 0
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);