From 62d8da06cd11f88163acd51fe2a27b0b005ef47f Mon Sep 17 00:00:00 2001 From: John Jolly Date: Sat, 6 Nov 2021 04:47:37 +0000 Subject: [PATCH] [user/ls]: List specific device file When using the ls userspace program to list a specific device file, nothing would be displayed. This was because ls only tests for T_FILE and T_DIR. T_DEVICE files would fall through the case block. Adding T_DEVICE to the T_FILE case allows a device file to be listed. $ ls console console 3 19 0 --- user/ls.c | 1 + 1 file changed, 1 insertion(+) diff --git a/user/ls.c b/user/ls.c index b54d951..c67b84b 100644 --- a/user/ls.c +++ b/user/ls.c @@ -42,6 +42,7 @@ ls(char *path) } switch(st.type){ + case T_DEVICE: case T_FILE: printf("%s %d %d %l\n", fmtname(path), st.type, st.ino, st.size); break;