summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1686f70)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2494
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
INFO0("SIGUSR1 received. Display the backtrace");
xbt_backtrace_display();
}
INFO0("SIGUSR1 received. Display the backtrace");
xbt_backtrace_display();
}
+
+static void gras_sigint_handler(int sig) {
+ static double lastone = 0;
+ if (lastone == 0 || gras_os_time() - lastone > 5) {
+ lastone = gras_os_time();
+ xbt_backtrace_display();
+ fprintf(stderr,"\nBacktrace displayed because Ctrl-C was pressed. Press again (within 5 sec) to abort the process.\n");
+ } else {
+ exit(1);
+ }
+}
#endif
void gras_init(int *argc,char **argv) {
#endif
void gras_init(int *argc,char **argv) {
gras_datadesc_init();
#if defined(HAVE_SIGNAL) && defined(HAVE_SIGNAL_H)
signal(SIGUSR1,gras_sigusr_handler);
gras_datadesc_init();
#if defined(HAVE_SIGNAL) && defined(HAVE_SIGNAL_H)
signal(SIGUSR1,gras_sigusr_handler);
+ signal(SIGINT,gras_sigint_handler);