From 72fa645bc1ae4e7fd4e70ecfe47649efc3dfbaa5 Mon Sep 17 00:00:00 2001 From: Adithya Kumar Date: Fri, 3 Jan 2025 18:55:44 +0530 Subject: [PATCH] Fix a bug in Posix.ReadDir.lstatDname --- core/src/Streamly/Internal/FileSystem/Posix/ReadDir.hsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/Streamly/Internal/FileSystem/Posix/ReadDir.hsc b/core/src/Streamly/Internal/FileSystem/Posix/ReadDir.hsc index c4788da440..eac23a9101 100644 --- a/core/src/Streamly/Internal/FileSystem/Posix/ReadDir.hsc +++ b/core/src/Streamly/Internal/FileSystem/Posix/ReadDir.hsc @@ -152,8 +152,8 @@ lstatDname parent dname = do Array.asCStringUnsafe (Path.toChunk path) $ \cStr -> do res <- c_lstat_is_directory cStr case res of - x | x == 0 -> pure (True, False) - x | x == 1 -> pure (False, False) + x | x == 1 -> pure (True, False) + x | x == 0 -> pure (False, False) -- XXX Need to check if and how we should handle some errors -- like EACCES. _ -> throwErrno "checkIfDirectory"