From de27058d0b2ec5c3d521809ff4ff4a094ef2d068 Mon Sep 17 00:00:00 2001 From: chrislu Date: Wed, 12 Jan 2022 21:45:38 -0800 Subject: [PATCH] POSIX: differentiate device and char device --- weed/util/fullpath.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/weed/util/fullpath.go b/weed/util/fullpath.go index d2fb017a1..6c4f5c6ae 100644 --- a/weed/util/fullpath.go +++ b/weed/util/fullpath.go @@ -52,7 +52,11 @@ func (fp FullPath) AsInode(fileMode os.FileMode) uint64 { } else if fileMode&os.ModeSymlink > 0 { inode += 2 } else if fileMode&os.ModeDevice > 0 { - inode += 3 + if fileMode&os.ModeCharDevice > 0 { + inode += 6 + } else { + inode += 3 + } } else if fileMode&os.ModeNamedPipe > 0 { inode += 4 } else if fileMode&os.ModeSocket > 0 {