summaryrefslogtreecommitdiff
path: root/Utility/Kqueue.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-20 15:03:24 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-20 15:03:24 -0400
commitda4c506d61115236f3e43dd0bd17f30cd54df950 (patch)
tree0f4833eed38ded546731ea9712fef636bf5933b1 /Utility/Kqueue.hs
parent833bd24a33f2f13051439865464918821ba5c65c (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.hs6
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. -}