[patch] Restore correct flags in stdioConsole::read

Dave Brolley <[email protected]>
Newsgroups gmane.comp.emulators.sid.devel
Organization Red Hat Canada, Ltd
Message-ID <[email protected]>
Hi,

I've committed the attached patch which restores the original flags in 
stdioConsole::read. The existing code was turning off O_NONBLOCK 
regardless of whether it was previously off.

FWIW, I found this while investigating a problem on my RHL8.0 system in 
which this function blocks when sid is running in the background. This 
patch is just something I noticed while looking. It does not solve the 
problem.

Dave
stdio-flags.patch.txt (text/plain, 1.1 KB)
Index: sid/component/consoles/stdio.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/consoles/stdio.cxx,v
retrieving revision 1.2
diff -c -p -r1.2 stdio.cxx
*** sid/component/consoles/stdio.cxx	17 Jan 2001 21:05:09 -0000	1.2
--- sid/component/consoles/stdio.cxx	14 Jul 2003 18:40:55 -0000
***************
*** 1,7 ****
  // stdio.cxx - A simple console that uses standard I/O for
  // enunciation.  -*- C++ -*-
  
! // Copyright (C) 1999, 2000 Red Hat.
  // This file is part of SID and is licensed under the GPL.
  // See the file COPYING.SID for conditions for redistribution.
  
--- 1,7 ----
  // stdio.cxx - A simple console that uses standard I/O for
  // enunciation.  -*- C++ -*-
  
! // Copyright (C) 1999, 2000, 2003 Red Hat.
  // This file is part of SID and is licensed under the GPL.
  // See the file COPYING.SID for conditions for redistribution.
  
*************** stdioConsole::read(host_int_4)
*** 49,55 ****
      }
  
    // Restore flags.
!   fcntl(0, F_SETFL, flags & ~O_NONBLOCK);
  }
  
  
--- 49,55 ----
      }
  
    // Restore flags.
!   fcntl(0, F_SETFL, flags);
  }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.