summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 8843afb38fe..a51cf6eed98 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -2135,24 +2135,27 @@ d_type_from_stat (struct stat *buf)
{
unsigned char d_type;
- if (buf->st_mode & S_IFREG) {
- d_type = DT_REG;
+ if (S_ISLNK (buf->st_mode)) {
+ d_type = DT_LNK;
- } else if (buf->st_mode & S_IFDIR) {
+ } else if (S_ISDIR (buf->st_mode)) {
d_type = DT_DIR;
- } else if (buf->st_mode & S_IFIFO) {
+ } else if (S_ISFIFO (buf->st_mode)) {
d_type = DT_FIFO;
- } else if (buf->st_mode & S_IFSOCK) {
+ } else if (S_ISSOCK (buf->st_mode)) {
d_type = DT_SOCK;
- } else if (buf->st_mode & S_IFCHR) {
+ } else if (S_ISCHR (buf->st_mode)) {
d_type = DT_CHR;
- } else if (buf->st_mode & S_IFBLK) {
+ } else if (S_ISBLK (buf->st_mode)) {
d_type = DT_BLK;
+ } else if (S_ISREG (buf->st_mode)) {
+ d_type = DT_REG;
+
} else {
d_type = DT_UNKNOWN;
}