socket interconnection skeleton
This commit is contained in:
parent
51c8931cbd
commit
7feb436240
@ -1,9 +1,9 @@
|
||||
include_HEADERS = $(top_srcdir)/yasnd.h
|
||||
include_HEADERS = $(top_srcdir)/yasnd.h yasnd-sock.h
|
||||
|
||||
yasnd_LDADD = ${libconfuse_LIBS}
|
||||
yasnd_LDADD += $(top_srcdir)/lib/libyasnd.la
|
||||
sbin_PROGRAMS = yasnd
|
||||
yasnd_SOURCES = yasnd.c yasnd-ipc.c
|
||||
yasnd_SOURCES = yasnd.c yasnd-ipc.c yasnd-sock.c
|
||||
yasnd_CPPFLAGS = -I$(top_srcdir)
|
||||
|
||||
distclean-local:
|
||||
|
7
daemon/yasnd-sock.c
Normal file
7
daemon/yasnd-sock.c
Normal file
@ -0,0 +1,7 @@
|
||||
int sock_init()
|
||||
{
|
||||
}
|
||||
|
||||
void sock_close()
|
||||
{
|
||||
}
|
8
daemon/yasnd-sock.h
Normal file
8
daemon/yasnd-sock.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef YASND_SOCK_H
|
||||
#define YASND_SOCK_H
|
||||
|
||||
// External functions
|
||||
extern int sock_init();
|
||||
extern void sock_close();
|
||||
|
||||
#endif
|
@ -9,6 +9,7 @@
|
||||
#include "yasnd-gammu.h"
|
||||
#include "yasnd-log.h"
|
||||
#include "yasnd-lpt.h"
|
||||
#include "yasnd-sock.h"
|
||||
|
||||
cfg_t *cfg; // pointer to configuration structure
|
||||
char pidfile[]="/var/run/yasnd.pid"; // pidfile path
|
||||
@ -154,6 +155,8 @@ void init()
|
||||
gammu_init();
|
||||
// initialize LPT control circuit
|
||||
lpt_init();
|
||||
// initialize server socket
|
||||
sock_init();
|
||||
}
|
||||
|
||||
void check_host(int num,host_decl* host)
|
||||
@ -285,6 +288,8 @@ void signal_handler(int signum)
|
||||
lpt_lock();
|
||||
// close log decriptor
|
||||
log_close();
|
||||
// close server socket
|
||||
sock_close();
|
||||
//
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user