Re: Signal handling in Win32 GUI programs

2009-01-13 Thread Andy Koppe
2009/1/13 Andy Koppe : > static const sigset_t term_sigs = >1

Re: Signal handling in Win32 GUI programs

2009-01-13 Thread Chris January
On Tue, Jan 13, 2009 at 7:29 AM, Andy Koppe wrote: > Actually I still can't quite get signal handling in MinTTY to work right. > SIGINT is fine, but SIGTERM, SIGHUP, and SIGKILL don't seem to get to > sigwait(), instead still invoking the default handler, i.e. terminating > MinTTY without SIGHUP be

Re: Signal handling in Win32 GUI programs

2009-01-12 Thread Andy Koppe
Actually I still can't quite get signal handling in MinTTY to work right. SIGINT is fine, but SIGTERM, SIGHUP, and SIGKILL don't seem to get to sigwait(), instead still invoking the default handler, i.e. terminating MinTTY without SIGHUP being sent to the command inside it. Here's what I got:

Re: Signal handling in Win32 GUI programs

2009-01-11 Thread Christopher Faylor
On Sun, Jan 11, 2009 at 08:53:49PM +, Andy Koppe wrote: >>>I've added a thread doing 'for (;;) pause();', but unfortunately that >>>doesn't seem to do the trick. Do I need to go into Cygwin internals >>>and wait directly on the Win32 event(s) used for signals? >>sigwait() will probably work be

Re: Signal handling in Win32 GUI programs

2009-01-11 Thread Andy Koppe
I've added a thread doing 'for (;;) pause();', but unfortunately that doesn't seem to do the trick. Do I need to go into Cygwin internals and wait directly on the Win32 event(s) used for signals? sigwait() will probably work better than pause. That indeed works, thank you very much! I didn't

Re: Signal handling in Win32 GUI programs

2009-01-11 Thread Christopher Faylor
On Sun, Jan 11, 2009 at 04:57:02PM +, Andy Koppe wrote: > Christopher Faylor wrote: >> I don't know if this is what you are seeing but If you are blocked in a >> Windows function like WaitMessage or WaitForSingleObject, the signal >> will not be delivered until some random time after you leave

Re: Signal handling in Win32 GUI programs

2009-01-11 Thread Andy Koppe
Christopher Faylor wrote: I don't know if this is what you are seeing but If you are blocked in a Windows function like WaitMessage or WaitForSingleObject, the signal will not be delivered until some random time after you leave the function. Alright, that's what it is then. One way around thi

Re: Signal handling in Win32 GUI programs

2009-01-11 Thread Christopher Faylor
On Sun, Jan 11, 2009 at 04:26:36PM +, Andy Koppe wrote: > Is there something special about signal handling in Win32 GUI programs? > With MinTTY, I'm finding that signals sent to it are only delivered when > writing data to the child process (i.e. when you try to kill it, it

Signal handling in Win32 GUI programs

2009-01-11 Thread Andy Koppe
Hi, Is there something special about signal handling in Win32 GUI programs? With MinTTY, I'm finding that signals sent to it are only delivered when writing data to the child process (i.e. when you try to kill it, it stays open until a key is pressed). I guess that's fair enough