summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
authorJohn Jolly <[email protected]>2021-11-06 04:47:37 +0000
committerFrans Kaashoek <[email protected]>2022-08-09 20:29:38 -0400
commit2462656f215822ffb3bcd854ddc68b3894058c59 (patch)
treeb4bb98b3b0a1f70755763aa6973c4fb8ace183e7 /user
parent9f3673c4da3c2a829fe74f4b950c50568ca937dc (diff)
downloadxv6-labs-2462656f215822ffb3bcd854ddc68b3894058c59.tar.gz
xv6-labs-2462656f215822ffb3bcd854ddc68b3894058c59.tar.bz2
xv6-labs-2462656f215822ffb3bcd854ddc68b3894058c59.zip
[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
Diffstat (limited to 'user')
-rw-r--r--user/ls.c1
1 files changed, 1 insertions, 0 deletions
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;