syssignal.c (302408) | syssignal.c (338530) |
---|---|
1#ifdef HAVE_CONFIG_H 2# include <config.h> 3#endif 4 5#include <stdio.h> 6#include <sys/types.h> 7#include <signal.h> 8 --- 124 unchanged lines hidden (view full) --- 133set_ctrl_c_hook( 134 ctrl_c_fn c_hook 135 ) 136{ 137 RETSIGTYPE (*handler)(int); 138 139 if (NULL == c_hook) { 140 handler = SIG_DFL; | 1#ifdef HAVE_CONFIG_H 2# include <config.h> 3#endif 4 5#include <stdio.h> 6#include <sys/types.h> 7#include <signal.h> 8 --- 124 unchanged lines hidden (view full) --- 133set_ctrl_c_hook( 134 ctrl_c_fn c_hook 135 ) 136{ 137 RETSIGTYPE (*handler)(int); 138 139 if (NULL == c_hook) { 140 handler = SIG_DFL; |
141 ctrl_c_hook = NULL; | 141 signal_no_reset(SIGINT, handler); 142 ctrl_c_hook = c_hook; |
142 } else { | 143 } else { |
143 handler = &sigint_handler; | |
144 ctrl_c_hook = c_hook; | 144 ctrl_c_hook = c_hook; |
145 handler = &sigint_handler; 146 signal_no_reset(SIGINT, handler); |
|
145 } | 147 } |
146 signal_no_reset(SIGINT, handler); | |
147} 148#else /* SYS_WINNT follows */ 149/* 150 * Windows implementation of set_ctrl_c_hook() 151 */ 152BOOL WINAPI 153console_event_handler( 154 DWORD dwCtrlType --- 34 unchanged lines hidden --- | 148} 149#else /* SYS_WINNT follows */ 150/* 151 * Windows implementation of set_ctrl_c_hook() 152 */ 153BOOL WINAPI 154console_event_handler( 155 DWORD dwCtrlType --- 34 unchanged lines hidden --- |