diff options
author | Joey Hess <joey@kitenet.net> | 2012-07-20 15:03:24 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-07-20 15:03:24 -0400 |
commit | da4c506d61115236f3e43dd0bd17f30cd54df950 (patch) | |
tree | 0f4833eed38ded546731ea9712fef636bf5933b1 /Utility/Kqueue.hs | |
parent | 833bd24a33f2f13051439865464918821ba5c65c (diff) |
use safe FFI imports
This avoids blocking all threads when calling waitchange_kqueue,
which blocks.
Diffstat (limited to 'Utility/Kqueue.hs')
-rw-r--r-- | Utility/Kqueue.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Utility/Kqueue.hs b/Utility/Kqueue.hs index c1a0a5cd6..f44893195 100644 --- a/Utility/Kqueue.hs +++ b/Utility/Kqueue.hs @@ -142,11 +142,11 @@ findDirContents dirmap dir = concatMap absolutecontents $ search search = map snd $ M.toList $ M.filter (\i -> dirName i == dir) dirmap -foreign import ccall unsafe "libkqueue.h init_kqueue" c_init_kqueue +foreign import ccall safe "libkqueue.h init_kqueue" c_init_kqueue :: IO Fd -foreign import ccall unsafe "libkqueue.h addfds_kqueue" c_addfds_kqueue +foreign import ccall safe "libkqueue.h addfds_kqueue" c_addfds_kqueue :: Fd -> CInt -> Ptr Fd -> IO () -foreign import ccall unsafe "libkqueue.h waitchange_kqueue" c_waitchange_kqueue +foreign import ccall safe "libkqueue.h waitchange_kqueue" c_waitchange_kqueue :: Fd -> IO Fd {- Initializes a Kqueue to watch a directory, and all its subdirectories. -} |