delorie.com/archives/browse.cgi | search |
To: | cygwin AT cygwin DOT com |
From: | "Joe Smith" <unknown_kev_cat AT hotmail DOT com> |
Subject: | Re: Can I get a sigint when the bash window closed with close window's button ? |
Date: | Tue, 15 Nov 2005 17:45:06 -0500 |
Lines: | 38 |
Message-ID: | <dldodk$eod$1@sea.gmane.org> |
References: | <896835389 AT web DOT de> <Pine DOT GSO DOT 4 DOT 63 DOT 0511151424250 DOT 15491 AT slinky DOT cs DOT nyu DOT edu> |
Mime-Version: | 1.0 |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
"Igor Pechtchanski" <pechtcha AT cs DOT nyu DOT edu> wrote in message news:Pine DOT GSO DOT 4 DOT 63 DOT 0511151424250 DOT 15491 AT slinky DOT cs DOT nyu DOT edu... > On Tue, 15 Nov 2005, Konrad Eisele wrote: > >> When th cygwin bash window is closed by clicking on the window's close >> button the the appliaction gets killed without recieving a sigint or any >> atexit called. Is there a way to be able to run cleanup code when the >> application is about to be killed? > > According to exceptions.cc, a SIGHUP will be sent to bash in this case. > Are you handling the right signal? > > BTW, the atexit() callback also should be called -- do you have a simple > testcase to reproduce the problem? > Igor I know nothing about signals, but this program when run inside bash does not seem to run callback() *ever*. ^c does not run it. Closing the bash window does not run it. But if you remove the loop then it *is* run. #include <stdio.h> void callback() { FILE *current; current=fopen("test.txt","a"); fprintf(current,"atexit"); } int main() { atexit(*callback); while(1) {}; } -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |