From: simonmar Date: Thu, 6 Feb 2003 10:41:13 +0000 (+0000) Subject: [project @ 2003-02-06 10:41:13 by simonmar] X-Git-Tag: nhc98-1-18-release~738 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=90acd04caed4eb4dbdd2033a1cd4bfdbc6c62c8b;p=haskell-directory.git [project @ 2003-02-06 10:41:13 by simonmar] 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 --- diff --git a/GHC/Posix.hs b/GHC/Posix.hs index a8e0f7b..53b0902 100644 --- a/GHC/Posix.hs +++ b/GHC/Posix.hs @@ -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