aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2016-02-20 13:51:02 -0500
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2016-02-20 13:58:20 -0500
commit4e5a3f6c53261d7b9b5f042a547fdab9e5243579 (patch)
treef53f4f564c21e23759ebe11c1ded8b443720bee2
parent251c10fd882038d4b2461bda2f8fc279d856a7cc (diff)
Use DTTOIF instead of implementing DirectoryTypeToFileType
-rw-r--r--src/operations.cc19
1 files changed, 1 insertions, 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<mode_t>(DTTOIF(type));
}
void* Initialize(fuse_conn_info*) {