Skip to content

Commit

Permalink
unix: fix stat on unknown file type
Browse files Browse the repository at this point in the history
make sure `unknownFileMode` const value matches what is returned when
file type failed to be determmined
  • Loading branch information
jpalus authored and charlievieth committed Jun 18, 2024
1 parent 9e83309 commit 78ddd19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastwalk_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 78ddd19

Please sign in to comment.