summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-01-07 10:55:42 -0500
committerTavian Barnes <tavianator@tavianator.com>2020-01-07 10:55:42 -0500
commit897dcb749cc02c45c14f90556b792115d8d1a05c (patch)
tree981dce9cb5816130d3bfa65a14e2a7a9444512cb /util.c
parent44d0d73b308eb19593f7c4e1232cbaa4c0078ae8 (diff)
downloadbfs-897dcb749cc02c45c14f90556b792115d8d1a05c.tar.xz
util: Support ports and whiteouts in format_mode()
Diffstat (limited to 'util.c')
-rw-r--r--util.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/util.c b/util.c
index 01fb1ae..edfc38d 100644
--- a/util.c
+++ b/util.c
@@ -178,6 +178,8 @@ void format_mode(mode_t mode, char str[11]) {
strcpy(str, "----------");
switch (bftw_mode_typeflag(mode)) {
+ case BFTW_REG:
+ break;
case BFTW_BLK:
str[0] = 'b';
break;
@@ -190,16 +192,24 @@ void format_mode(mode_t mode, char str[11]) {
case BFTW_DOOR:
str[0] = 'D';
break;
+ case BFTW_LNK:
+ str[0] = 'l';
+ break;
case BFTW_FIFO:
str[0] = 'p';
break;
- case BFTW_LNK:
- str[0] = 'l';
+ case BFTW_PORT:
+ str[0] = 'P';
break;
case BFTW_SOCK:
str[0] = 's';
break;
- default:
+ case BFTW_WHT:
+ str[0] = 'w';
+ break;
+ case BFTW_UNKNOWN:
+ case BFTW_ERROR:
+ str[0] = '?';
break;
}