From e72ea1f2af65107b120c81756fa123546437b76e Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sun, 20 Nov 2011 14:55:44 +0000 Subject: Fix and enable posix014 --- testsuite/tests/lib/libposix/all.T | 1 + testsuite/tests/lib/libposix/posix014.hs | 24 +++++++++--------------- testsuite/tests/lib/libposix/posix014.stdout | 1 + 3 files changed, 11 insertions(+), 15 deletions(-) create mode 100644 testsuite/tests/lib/libposix/posix014.stdout (limited to 'testsuite') diff --git a/testsuite/tests/lib/libposix/all.T b/testsuite/tests/lib/libposix/all.T index 9ac16925b4..b925a9dabd 100644 --- a/testsuite/tests/lib/libposix/all.T +++ b/testsuite/tests/lib/libposix/all.T @@ -5,3 +5,4 @@ test('posix005', [reqlib('unix'), expect_broken(5648)], compile_and_run, ['']) test('posix006', reqlib('unix'), compile_and_run, ['']) test('posix009', reqlib('unix'), compile_and_run, ['']) test('posix010', reqlib('unix'), compile_and_run, ['']) +test('posix014', reqlib('unix'), compile_and_run, ['']) diff --git a/testsuite/tests/lib/libposix/posix014.hs b/testsuite/tests/lib/libposix/posix014.hs index bb3518c440..9d844b20ce 100644 --- a/testsuite/tests/lib/libposix/posix014.hs +++ b/testsuite/tests/lib/libposix/posix014.hs @@ -1,19 +1,13 @@ ---!! Basic pipe usage -module Main(main) where +-- !! Basic pipe usage +module Main (main) where -import Posix +import System.Posix main = do - str <- getEffectiveUserName - putStrLn str (rd, wd) <- createPipe - n <- forkProcess - case n of - Nothing -> do - (str,_) <- fdRead rd 32 - -- avoid them zombies - putStrLn str - Just pid -> do - fdWrite wd "Hi, there - forked child calling" --- getProcessStatus False True pid - return () + pid <- forkProcess $ do (str, _) <- fdRead rd 32 + putStrLn str + fdWrite wd "Hi, there - forked child calling" + getProcessStatus True False pid + return () + diff --git a/testsuite/tests/lib/libposix/posix014.stdout b/testsuite/tests/lib/libposix/posix014.stdout new file mode 100644 index 0000000000..cab0a57734 --- /dev/null +++ b/testsuite/tests/lib/libposix/posix014.stdout @@ -0,0 +1 @@ +Hi, there - forked child calling -- cgit v1.2.1