Split out GAMMU-related code from library into daemon.
Add proper optional support for GAMMU via build-time options. This commit fixes #4, but some additional checks maybe needed.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include "config.h"
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
@@ -152,9 +153,11 @@ void init()
|
||||
hosts[i].alert_sent=false;
|
||||
hosts[i].reaction_obtained=false;
|
||||
}
|
||||
#ifdef HAVE_LIBGAMMU
|
||||
// initialize gammu structures
|
||||
if (sms_enable)
|
||||
gammu_init();
|
||||
#endif
|
||||
// initialize LPT control circuit
|
||||
lpt_init();
|
||||
// initialize server socket
|
||||
@@ -281,8 +284,10 @@ void signal_handler(int signum)
|
||||
ipc_free();
|
||||
// free config structure
|
||||
cfg_free(cfg);
|
||||
#ifdef HAVE_LIBGAMMU
|
||||
// free gammu structure
|
||||
gammu_free();
|
||||
#endif
|
||||
// free hosts structures memory
|
||||
if (hosts!=NULL)
|
||||
free(hosts);
|
||||
|
||||
Reference in New Issue
Block a user