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:
2013-09-02 22:54:14 +04:00
parent badad6874c
commit a1c83a3df2
8 changed files with 23 additions and 8 deletions

View File

@@ -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);