diff --git a/yasnd.c b/yasnd.c index 142aa39..8e7ac0e 100644 --- a/yasnd.c +++ b/yasnd.c @@ -22,6 +22,7 @@ char* phone_connection=NULL; // gammu phone connection type, for example: "at" char* recipient_number=NULL; // recipient of sms alerts bool loop_locked=false ; // flag for locking main loop while config re-reading int failures_first=3 ; // count of failures while hosts checking, that triggers first SMS sending +pid_t mainloop_clone_pid; // pid of clone process, that containt main loop void log_debug(const char *message,int verbosity) { @@ -158,8 +159,12 @@ void reset_pin(int pin_num) outb (0, LPTPORT); } -void loop_function() +int loop_function() { + // set default signal handlers + signal(SIGTERM,SIG_DFL); + signal(SIGHUP,SIG_DFL); + // for (int i=0;i