From 78ddd192101087c8caed66c225cbaa3d89686e16 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Mon, 17 Jun 2024 15:55:32 +0200 Subject: [PATCH] unix: fix stat on unknown file type make sure `unknownFileMode` const value matches what is returned when file type failed to be determmined --- fastwalk_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastwalk_unix.go b/fastwalk_unix.go index ad85f9e..67a6d97 100644 --- a/fastwalk_unix.go +++ b/fastwalk_unix.go @@ -19,7 +19,7 @@ const blockSize = 8192 // unknownFileMode is a sentinel (and bogus) os.FileMode // value used to represent a syscall.DT_UNKNOWN Dirent.Type. -const unknownFileMode os.FileMode = os.ModeNamedPipe | os.ModeSocket | os.ModeDevice +const unknownFileMode os.FileMode = ^os.FileMode(0) func readDir(dirName string, fn func(dirName, entName string, de fs.DirEntry) error) error { fd, err := open(dirName, 0, 0)