Commit 99d658e8 authored by qrczak's avatar qrczak
Browse files

[project @ 2001-01-12 17:45:30 by qrczak]

Add resetErrno :: IO ()
Use it in Directory, before calling readdir.
parent af58ba6d
-- -----------------------------------------------------------------------------
-- $Id: Directory.hsc,v 1.2 2001/01/12 15:48:56 simonmar Exp $
-- $Id: Directory.hsc,v 1.3 2001/01/12 17:45:30 qrczak Exp $
--
-- (c) The University of Glasgow, 1994-2000
--
......@@ -345,6 +345,7 @@ getDirectoryContents path = do
where
loop :: Ptr CDir -> IO [String]
loop dir = do
resetErrno
p <- readdir dir
if (p /= nullPtr)
then do entry <- peekCString ((#ptr struct dirent,d_name) p)
......
% -----------------------------------------------------------------------------
% $Id: PrelCError.lhs,v 1.1 2001/01/11 17:25:57 simonmar Exp $
% $Id: PrelCError.lhs,v 1.2 2001/01/12 17:45:30 qrczak Exp $
%
% (c) The FFI task force, 2000
%
......@@ -39,6 +39,7 @@ module PrelCError (
-- access to the current thread's "errno" value
--
getErrno, -- :: IO Errno
resetErrno, -- :: IO ()
-- conversion of an "errno" value into IO error
--
......@@ -281,6 +282,12 @@ getErrno :: IO Errno
getErrno = liftM Errno (peek _errno)
-- set the current thread's "errno" value to 0
--
resetErrno :: IO ()
resetErrno = poke _errno 0
-- throw current "errno" value
-- ---------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment