diff --git a/common/os_calls.c b/common/os_calls.c index 1939ddc9..c5a15bb0 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -2500,6 +2500,17 @@ g_signal_child_stop(void (*func)(int)) #endif } +/*****************************************************************************/ + +void APP_CC +g_signal_segfault(void (*func)(int)) +{ +#if defined(_WIN32) +#else + signal(SIGSEGV, func); +#endif +} + /*****************************************************************************/ /* does not work in win32 */ void APP_CC diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c index 26d4182e..d81c488d 100644 --- a/sesman/chansrv/chansrv.c +++ b/sesman/chansrv/chansrv.c @@ -1044,7 +1044,7 @@ child_signal_handler(int sig) { int i1; - LOG(10, ("child_signal_handler:")); + LOG(0, ("child_signal_handler:")); do { @@ -1061,6 +1061,14 @@ child_signal_handler(int sig) while (i1 >= 0); } +void DEFAULT_CC +segfault_signal_handler(int sig) +{ + LOG(0, ("segfault_signal_handler: entered.......")); + xfuse_deinit(); + exit(0); +} + /*****************************************************************************/ static int APP_CC get_display_num_from_display(char *display_text) @@ -1272,6 +1280,8 @@ main(int argc, char **argv) g_signal_user_interrupt(term_signal_handler); /* SIGINT */ g_signal_pipe(nil_signal_handler); /* SIGPIPE */ g_signal_child_stop(child_signal_handler); /* SIGCHLD */ + g_signal_segfault(segfault_signal_handler); + display_text = g_getenv("DISPLAY"); LOGM((LOG_LEVEL_INFO, "main: DISPLAY env var set to %s", display_text)); get_display_num_from_display(display_text);