diff --git a/tests/libposix/all.T b/tests/libposix/all.T
index a266040d3d9741c7703efcb9862625cf56c40b76..3fb52ecf06cd6775984f7aceb146a368ae2cef67 100644
--- a/tests/libposix/all.T
+++ b/tests/libposix/all.T
@@ -6,7 +6,7 @@ test('posix003', if_os('mingw32', skip), compile_and_run, [''])
 
 test('posix004', [ reqlib('unix') ], compile_and_run, [''])
 
-test('posix005', [reqlib('unix'), expect_broken(5648)], compile_and_run, [''])
+test('posix005', [reqlib('unix') ], compile_and_run, [''])
 
 test('posix006', reqlib('unix'), compile_and_run, [''])
 test('posix009', [ omit_ways(threaded_ways), reqlib('unix') ], compile_and_run, [''])
diff --git a/tests/libposix/posix005.hs b/tests/libposix/posix005.hs
index 9ca569ccccb12f76734386c952df679c0a7f722c..4365eb52bdd58c7a95a030794d70a5450d943f0e 100644
--- a/tests/libposix/posix005.hs
+++ b/tests/libposix/posix005.hs
@@ -4,8 +4,8 @@ import System.Posix.Env
 
 main = do
     hSetBuffering stdout NoBuffering
-    term <- getEnvVar "TERM"
-    putStrLn term
+    term <- getEnv "TERM"
+    maybe (return ()) putStrLn term
     setEnvironment [("one","1"),("two","2")]
     getEnvironment >>= print
     setEnv "foo" "bar" True
@@ -16,6 +16,6 @@ main = do
     getEnvironment >>= print
     unsetEnv "foo"
     getEnvironment >>= print
-    setEnvironment []
+    clearEnv
     getEnvironment >>= print
 
diff --git a/tests/libposix/posix005.stdout b/tests/libposix/posix005.stdout
index 9896f43da725a391a1585208955c0e9d3c663cbc..ace79ee2e06003e8d981ac13ed1a45f92293c1bb 100644
--- a/tests/libposix/posix005.stdout
+++ b/tests/libposix/posix005.stdout
@@ -1,4 +1,4 @@
-emacs
+vt100
 [("one","1"),("two","2")]
 [("one","1"),("two","2"),("foo","bar")]
 [("one","1"),("two","2"),("foo","baz")]