Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com X-Apparently-From: From: "bucweat_20657" To: Subject: signals and VC++ Date: Tue, 21 Aug 2001 19:55:09 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Hi, I'm compiling programs using VC++ 6.0 w/ SP5. It would be nice to compile everything in cygwin, but that's not always possible. But it does make a great shell replacement. Anyway, I'm using signals to catch the control-c so I can end the program nicely. The handler sets a flag, causing the while loop to bail, at which point the program cleans up after itself...all pretty typical stuff. This works fine when compiled via VC++ and run via DOS cmd.exe. However, when running this VC++ compiled program in cygwin bash shell, the signal is caught and the handler runs, but the main program quits before the post-while-loop clean up code can run. I've put a bunch of cout statements after the while loop and it typically will stop somewhere in the middle of one of them. It appears that the signal handler is running in a separate thread, as I can put a delay in the handler and then I get no post-while-loop output. It looks like control-c is sending a kill like statement to the main program such that it does not finish correctly. If I compile the same program using cygwin gcc the signals are handled fine. So, it would appear that code compiled using VC++ and run in cygwin shell will not handle the signals as expected. Is this the expected behavior? Is there a work-around for this? Am I missing something obvious? I modifed an signal code example I found in one of the cygwin lists to illustrate and could post to the list is that would help explain whats going on... VR, Charlie _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/