From 28a7a416f55bcc6440766cd073b69e47f66fbc63 Mon Sep 17 00:00:00 2001
From: David Terei <davidterei@gmail.com>
Date: Thu, 5 Jan 2012 19:02:27 -0800
Subject: [PATCH] Fix validation error
---
System/Posix/Temp.hsc | 4 +++-
System/Posix/Temp/ByteString.hsc | 6 ++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/System/Posix/Temp.hsc b/System/Posix/Temp.hsc
index bfbfee1..9989ca0 100644
--- a/System/Posix/Temp.hsc
+++ b/System/Posix/Temp.hsc
@@ -25,7 +25,9 @@ module System.Posix.Temp (
import System.IO
import System.Posix.IO
import System.Posix.Types
+#if !defined(__GLASGOW_HASKELL__) && !defined(__HUGS__)
import System.Posix.Directory (createDirectory)
+#endif
import Foreign.C
#if __GLASGOW_HASKELL__ > 700
@@ -78,7 +80,7 @@ mkdtemp template' = do
let template = template' ++ "XXXXXX"
#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
withFilePath template $ \ ptr -> do
- throwErrnoIfNull "mkdtemp" (c_mkdtemp ptr)
+ _ <- throwErrnoIfNull "mkdtemp" (c_mkdtemp ptr)
name <- peekFilePath ptr
return name
#else
diff --git a/System/Posix/Temp/ByteString.hsc b/System/Posix/Temp/ByteString.hsc
index 7479614..a13e45a 100644
--- a/System/Posix/Temp/ByteString.hsc
+++ b/System/Posix/Temp/ByteString.hsc
@@ -22,10 +22,12 @@ module System.Posix.Temp.ByteString (
#include "HsUnix.h"
-import System.IO ( Handle, openFile, IOMode(..) )
+import System.IO
import System.Posix.IO
import System.Posix.Types
+#if !defined(__GLASGOW_HASKELL__) && !defined(__HUGS__)
import System.Posix.Directory (createDirectory)
+#endif
import Foreign.C
@@ -69,7 +71,7 @@ mkdtemp template' = do
let template = template' `B.append` (BC.pack "XXXXXX")
#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
withFilePath template $ \ ptr -> do
- throwErrnoIfNull "mkdtemp" (c_mkdtemp ptr)
+ _ <- throwErrnoIfNull "mkdtemp" (c_mkdtemp ptr)
name <- peekFilePath ptr
return name
#else
--
GitLab