diff --git a/configure.ac b/configure.ac
index ec810fc..ee4199f 100644
--- a/configure.ac
+++ b/configure.ac
AM_CONDITIONAL(BTPCLIENT, test "${enable_btpclient}" = "yes")
if (test "${enable_btpclient}" = "yes" || test "${enable_mesh}" = "yes"); then
- PKG_CHECK_MODULES(ELL, ell >= 0.3, enable_ell=yes,
- AC_MSG_ERROR(ell library >= 0.3 is required))
+ PKG_CHECK_MODULES(ELL, ell >= 0.14, enable_ell=yes,
+ AC_MSG_ERROR(ell library >= 0.14 is required))
AC_SUBST(ELL_CFLAGS)
AC_SUBST(ELL_LIBS)
fi
diff --git a/mesh/main.c b/mesh/main.c
index 289b058..97f506a 100644
--- a/mesh/main.c
+++ b/mesh/main.c
#include <stdio.h>
#include <unistd.h>
#include <ctype.h>
+#include <signal.h>
#include <sys/stat.h>
#include <ell/ell.h>
"\t--help Show %s information\n", __func__);
}
-static void signal_handler(struct l_signal *signal, uint32_t signo,
- void *user_data)
+static void signal_handler(uint32_t signo, void *user_data)
{
static bool terminated;
- switch (signo) {
- case SIGINT:
- case SIGTERM:
- if (terminated)
- return;
- l_info("Terminating");
- l_main_quit();
- terminated = true;
- break;
- }
+ if (terminated)
+ return;
+
+ l_info("Terminating");
+ l_main_quit();
+ terminated = true;
}
int main(int argc, char *argv[])
{
int status;
bool detached = true;
- struct l_signal *signal;
- sigset_t mask;
struct bt_mesh *mesh = NULL;
const char *config_file = NULL;
int index = MGMT_INDEX_NONE;
goto done;
}
- sigemptyset(&mask);
- sigaddset(&mask, SIGINT);
- sigaddset(&mask, SIGTERM);
- signal = l_signal_create(&mask, signal_handler, NULL, NULL);
-
umask(0077);
if (detached) {
}
}
- status = l_main_run();
-
- l_signal_remove(signal);
+ status = l_main_run_with_signal(signal_handler, NULL);
done:
mesh_unref(mesh);