From 0ae11b0a28a482d1bf49b04899ca724ebf13026c Mon Sep 17 00:00:00 2001 From: qrczak Date: Fri, 18 May 2001 18:27:20 +0000 Subject: [PATCH] [project @ 2001-05-18 18:27:20 by qrczak] Prelude isn't available yet. --- ghc/lib/std/PrelPosix.hsc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ghc/lib/std/PrelPosix.hsc b/ghc/lib/std/PrelPosix.hsc index 7d69447..254c632 100644 --- a/ghc/lib/std/PrelPosix.hsc +++ b/ghc/lib/std/PrelPosix.hsc @@ -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 -- 1.7.10.4