follow change in System.Posix.Internals.c_open
authorSimon Marlow <marlowsd@gmail.com>
Mon, 22 Jun 2009 14:07:24 +0000 (14:07 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Mon, 22 Jun 2009 14:07:24 +0000 (14:07 +0000)
utils/ghc-pkg/Main.hs

index 19052a5..d5baf9f 100644 (file)
@@ -1342,8 +1342,12 @@ openNewFile dir template = do
 
     oflags = rw_flags .|. o_EXCL
 
+#if __GLASGOW_HASKELL__ < 611
+    withFilePath = withCString
+#endif
+
     findTempName x = do
-      fd <- withCString filepath $ \ f ->
+      fd <- withFilePath filepath $ \ f ->
               c_open f oflags 0o666
       if fd < 0
        then do