[project @ 2001-05-18 18:27:20 by qrczak]
authorqrczak <unknown>
Fri, 18 May 2001 18:27:20 +0000 (18:27 +0000)
committerqrczak <unknown>
Fri, 18 May 2001 18:27:20 +0000 (18:27 +0000)
Prelude isn't available yet.

ghc/lib/std/PrelPosix.hsc

index 7d69447..254c632 100644 (file)
@@ -1,7 +1,7 @@
-{-# OPTIONS -optc-DNON_POSIX_SOURCE #-}
+{-# OPTIONS -fno-implicit-prelude -optc-DNON_POSIX_SOURCE #-}
 
 -- ---------------------------------------------------------------------------
--- $Id: PrelPosix.hsc,v 1.1 2001/05/18 16:54:05 simonmar Exp $
+-- $Id: PrelPosix.hsc,v 1.2 2001/05/18 18:27:20 qrczak Exp $
 --
 -- POSIX support layer for the standard libraries
 --
@@ -10,7 +10,10 @@ module PrelPosix where
 
 #include "HsStd.h"
 
-import Monad
+import PrelBase
+import PrelNum
+import PrelReal
+import PrelMaybe
 import PrelCString
 import PrelPtr
 import PrelWord
@@ -133,13 +136,15 @@ setCooked fd cooked =
     (#poke struct termios, c_lflag) p_tios (new_c_lflag :: CTcflag)
 
     -- set VMIN & VTIME to 1/0 respectively
-    when cooked $
-        do let c_cc  = (#ptr struct termios, c_cc) p_tios
-               vmin  = c_cc `plusPtr` (#const VMIN)  :: Ptr Word8
+    if cooked
+       then do
+           let c_cc  = (#ptr struct termios, c_cc) p_tios
+               vmin  = c_cc `plusPtr` (#const VMIN)  :: Ptr Word8
                vtime = c_cc `plusPtr` (#const VTIME) :: Ptr Word8
            poke vmin  1
            poke vtime 0
-       
+       else return ()
+
     tcSetAttr fd (#const TCSANOW) p_tios
 
 -- tcsetattr() when invoked by a background process causes the process