* [PATCH BlueZ v2] mesh: Up-rev ELL dependancies to >= 0.14
@ 2018-11-22 19:41 Brian Gix
2018-11-28 17:05 ` Gix, Brian
0 siblings, 1 reply; 2+ messages in thread
From: Brian Gix @ 2018-11-22 19:41 UTC (permalink / raw)
To: linux-bluetooth; +Cc: johan.hedberg, inga.stotland, marcel, Brian Gix
---
configure.ac | 4 ++--
mesh/main.c | 31 +++++++++----------------------
2 files changed, 11 insertions(+), 24 deletions(-)
diff --git a/configure.ac b/configure.ac
index ec810fcf4..ee4199f4d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -249,8 +249,8 @@ AC_ARG_ENABLE(btpclient, AC_HELP_STRING([--enable-btpclient],
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 289b0582b..97f506a75 100644
--- a/mesh/main.c
+++ b/mesh/main.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <unistd.h>
#include <ctype.h>
+#include <signal.h>
#include <sys/stat.h>
#include <ell/ell.h>
@@ -59,29 +60,22 @@ static void usage(void)
"\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;
@@ -140,11 +134,6 @@ int main(int argc, char *argv[])
goto done;
}
- sigemptyset(&mask);
- sigaddset(&mask, SIGINT);
- sigaddset(&mask, SIGTERM);
- signal = l_signal_create(&mask, signal_handler, NULL, NULL);
-
umask(0077);
if (detached) {
@@ -155,9 +144,7 @@ int main(int argc, char *argv[])
}
}
- status = l_main_run();
-
- l_signal_remove(signal);
+ status = l_main_run_with_signal(signal_handler, NULL);
done:
mesh_unref(mesh);
--
2.14.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH BlueZ v2] mesh: Up-rev ELL dependancies to >= 0.14
2018-11-22 19:41 [PATCH BlueZ v2] mesh: Up-rev ELL dependancies to >= 0.14 Brian Gix
@ 2018-11-28 17:05 ` Gix, Brian
0 siblings, 0 replies; 2+ messages in thread
From: Gix, Brian @ 2018-11-28 17:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: johan.hedberg, Stotland, Inga, marcel
This patch has been applied, and Mesh now requires an ELL version >= 0.14 to build.
> -----Original Message-----
> From: Gix, Brian
> Sent: Thursday, November 22, 2018 11:41 AM
> To: linux-bluetooth@vger.kernel.org
> Cc: johan.hedberg@gmail.com; Stotland, Inga <inga.stotland@intel.com>;
> marcel@holtmann.org; Gix, Brian <brian.gix@intel.com>
> Subject: [PATCH BlueZ v2] mesh: Up-rev ELL dependancies to >= 0.14
>
> ---
> configure.ac | 4 ++--
> mesh/main.c | 31 +++++++++----------------------
> 2 files changed, 11 insertions(+), 24 deletions(-)
>
> diff --git a/configure.ac b/configure.ac index ec810fcf4..ee4199f4d 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -249,8 +249,8 @@ AC_ARG_ENABLE(btpclient, AC_HELP_STRING([--
> enable-btpclient],
> 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 289b0582b..97f506a75 100644
> --- a/mesh/main.c
> +++ b/mesh/main.c
> @@ -26,6 +26,7 @@
> #include <stdio.h>
> #include <unistd.h>
> #include <ctype.h>
> +#include <signal.h>
>
> #include <sys/stat.h>
> #include <ell/ell.h>
> @@ -59,29 +60,22 @@ static void usage(void)
> "\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;
> @@ -140,11 +134,6 @@ int main(int argc, char *argv[])
> goto done;
> }
>
> - sigemptyset(&mask);
> - sigaddset(&mask, SIGINT);
> - sigaddset(&mask, SIGTERM);
> - signal = l_signal_create(&mask, signal_handler, NULL, NULL);
> -
> umask(0077);
>
> if (detached) {
> @@ -155,9 +144,7 @@ int main(int argc, char *argv[])
> }
> }
>
> - status = l_main_run();
> -
> - l_signal_remove(signal);
> + status = l_main_run_with_signal(signal_handler, NULL);
>
> done:
> mesh_unref(mesh);
> --
> 2.14.5
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-28 17:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-22 19:41 [PATCH BlueZ v2] mesh: Up-rev ELL dependancies to >= 0.14 Brian Gix
2018-11-28 17:05 ` Gix, Brian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).