diff options
Diffstat (limited to 'System/Posix/Env.hsc')
-rw-r--r-- | System/Posix/Env.hsc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/System/Posix/Env.hsc b/System/Posix/Env.hsc index df7a3fe..39db08c 100644 --- a/System/Posix/Env.hsc +++ b/System/Posix/Env.hsc @@ -79,10 +79,11 @@ getEnvironment = do unsetEnv :: String -> IO () #ifdef HAVE_UNSETENV -unsetEnv name = withCString name c_unsetenv +unsetEnv name = withCString name $ \ s -> + throwErrnoIfMinus1_ "unsetenv" (c_unsetenv s) -foreign import ccall unsafe "unsetenv" - c_unsetenv :: CString -> IO () +foreign import ccall unsafe "__hsunix_unsetenv" + c_unsetenv :: CString -> IO CInt #else unsetEnv name = putEnv (name ++ "=") #endif |