From 4e5a3f6c53261d7b9b5f042a547fdab9e5243579 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sat, 20 Feb 2016 13:51:02 -0500 Subject: Use DTTOIF instead of implementing DirectoryTypeToFileType --- src/operations.cc | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/operations.cc b/src/operations.cc index 021f447..c799322 100644 --- a/src/operations.cc +++ b/src/operations.cc @@ -49,24 +49,7 @@ Directory* FileInfoDirectory(fuse_file_info* const file_info) { } mode_t DirectoryTypeToFileType(const unsigned char type) { - switch (type) { - case DT_BLK: - return S_IFBLK; - case DT_CHR: - return S_IFCHR; - case DT_DIR: - return S_IFDIR; - case DT_FIFO: - return S_IFIFO; - case DT_LNK: - return S_IFLNK; - case DT_REG: - return S_IFREG; - case DT_SOCK: - return S_IFSOCK; - default: - return 0; - } + return static_cast(DTTOIF(type)); } void* Initialize(fuse_conn_info*) { -- cgit v1.2.3