| 78 | static struct sigaction action; |
| 79 | |
| 80 | static void sighup_hdlr(int sig) |
| 81 | { |
| 82 | if(sig == SIGINT) |
| 83 | log_critical("SIGINT detected! PhotoRec has been killed.\n"); |
| 84 | else if(sig == SIGHUP) |
| 85 | log_critical("SIGHUP detected! PhotoRec has been killed.\n"); |
| 86 | else |
| 87 | log_critical("SIGTERM detected! PhotoRec has been killed.\n"); |
| 88 | log_flush(); |
| 89 | if(need_to_stop==1) |
| 90 | { |
| 91 | action.sa_handler=SIG_DFL; |
| 92 | sigaction(sig,&action,NULL); |
| 93 | kill(0, sig); |
| 94 | return ; |
| 95 | } |
| 96 | need_to_stop=1; |
| 97 | } |
| 98 | #endif |
| 99 | |
| 100 | static void display_help(void) |