[project @ 2003-02-06 10:41:13 by simonmar]
authorsimonmar <unknown>
Thu, 6 Feb 2003 10:41:13 +0000 (10:41 +0000)
committersimonmar <unknown>
Thu, 6 Feb 2003 10:41:13 +0000 (10:41 +0000)
Aargh!  We were setting the VMIN and VTIME values in the termios
structure when the terminal is in non-raw mode, rather than raw mode,
because I had a test round the wrong way.

Apparently on Linux VMIN and VTIME default to 1/0, so it apparently
worked properly, but on Solaris the VMIN slot in the c_cc array is
shared with the VEOF slot, which meant that VMIN was being left as 4
(the value of ^D, which is the default contents of VEOF).

Thanks to Hal Daume for reporting the bug, and Malcolm Wallce &
Lennart Augustsson for helping to point me in the right direction.

MERGE TO STABLE

GHC/Posix.hs

index a8e0f7b..53b0902 100644 (file)
@@ -189,7 +189,7 @@ setCooked fd cooked =
     poke_c_lflag p_tios (new_c_lflag :: CTcflag)
 
     -- set VMIN & VTIME to 1/0 respectively
-    when cooked $ do
+    when (not cooked) $ do
             c_cc <- ptr_c_cc p_tios
            let vmin  = (c_cc `plusPtr` (fromIntegral const_vmin))  :: Ptr Word8
                vtime = (c_cc `plusPtr` (fromIntegral const_vtime)) :: Ptr Word8