Date: Tue, 2 Sep 1997 19:17:02 +0300 (IDT) From: Eli Zaretskii To: Oberhumer Markus cc: djgpp-workers Subject: Re: stdin binmode + Ctrl-Break In-Reply-To: <199709021417.KAA11346@delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 2 Sep 1997, Oberhumer Markus wrote: > But for some reason Ctrl-Break doesn't work either, so if I > forget to redirect stdin on the command line I have to reboot ! > > Am I missing something ? You forget that signal handling is delayed until your app is back in protected mode and in its main thread. Since your program is parked inside a real-mode DOS call (that reads from stdin), you never get to handle the signal. That is why any program that could read binary data from stdin, should do this: if (!isatty (fileno (stdin))) setmode (fileno (stdin), O_BINARY); It doesn't make any sense to switch stdin to binary mode if it is the console device anyway (can you think of any situation that this is required?).