diff options
author | John Jolly <[email protected]> | 2021-11-06 04:47:37 +0000 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2022-08-09 20:27:46 -0400 |
commit | 62d8da06cd11f88163acd51fe2a27b0b005ef47f (patch) | |
tree | e0ad0e1fcab48cce8498e726a31928aee2df7611 | |
parent | 96da76a728d5737e05f1ef19c87ec6eb740f2e8c (diff) | |
download | xv6-labs-62d8da06cd11f88163acd51fe2a27b0b005ef47f.tar.gz xv6-labs-62d8da06cd11f88163acd51fe2a27b0b005ef47f.tar.bz2 xv6-labs-62d8da06cd11f88163acd51fe2a27b0b005ef47f.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
-rw-r--r-- | user/ls.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; |