update it

This commit is contained in:
Sukchan Lee 2017-02-26 16:01:54 +09:00
parent c32191d9e7
commit ff8d1eb91c
3 changed files with 11 additions and 10 deletions

View File

@ -16,6 +16,7 @@ cellwired_LDADD = \
AM_CPPFLAGS = \
-I$(top_srcdir)/lib/core/include \
-I$(top_srcdir)/lib/logger \
-I$(top_srcdir)/lib/s6a \
-I$(top_srcdir)/src
CLEANFILES = symtbl.c

View File

@ -12,7 +12,7 @@
static void s6a_gnutls_log_func(int level, const char *str);
static void s6a_fd_logger(int printlevel, const char *format, va_list ap);
status_t s6a_thread_start(int hss)
status_t s6a_fd_init(int hss)
{
int ret;
@ -66,7 +66,7 @@ status_t s6a_thread_start(int hss)
return CORE_OK;
}
void s6a_thread_stop()
void s6a_fd_final()
{
int ret;
@ -77,12 +77,6 @@ void s6a_thread_stop()
{
d_error("fd_core_shutdown() failed");
}
ret = fd_core_wait_shutdown_complete();
if (ret != 0)
{
d_error("fd_core_wait_shutdown_complete() failed");
}
}
static void s6a_gnutls_log_func(int level, const char *str)

10
main.c
View File

@ -14,6 +14,8 @@
#include "logger.h"
#include "symtbl.h"
#include "s6a_lib.h"
/* Server */
#include "cellwire.h"
@ -53,6 +55,8 @@ static int check_signal(int signum)
d_info("%s received",
signum == SIGTERM ? "SIGTERM" : "SIGINT");
s6a_fd_final();
threads_stop();
return 1;
@ -108,7 +112,7 @@ void test_signal(int signum)
{
case SIGTERM:
case SIGINT:
s6a_thread_stop();
s6a_fd_final();
break;
case SIGHUP:
break;
@ -219,12 +223,14 @@ int main(int argc, char *argv[])
core_signal(SIGTERM, test_signal);
core_signal(SIGHUP, test_signal);
s6a_thread_start(1);
s6a_fd_init(1);
fd_core_wait_shutdown_complete();
return EXIT_SUCCESS;
}
/* Parent */
s6a_fd_init(0);
}
{