Hi Patrik,

> Add compile time configuration switch '--enable-external-stacktrace'
> to let operating system/distribution handle stack traces. The default
> is to have ConnMan to print out a backtrace as before.
> ---
>  Makefile.am  |    3 ++-
>  configure.ac |   11 +++++++++++
>  src/log.c    |    6 ++++++
>  3 files changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index fe8e75d..4394612 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -120,7 +120,8 @@ AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
>                               -DPLUGINDIR=\""$(build_plugindir)"\" \
>                               -DSCRIPTDIR=\""$(build_scriptdir)"\" \
>                               -DSTORAGEDIR=\""$(storagedir)\"" \
> -                             -DCONFIGDIR=\""$(configdir)\""
> +                             -DCONFIGDIR=\""$(configdir)\"" \
> +                             -DEXTERNAL_STACK_TRACE=@EXT_STACKTRACE@
>  
>  INCLUDES = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
>  
> diff --git a/configure.ac b/configure.ac
> index 1e473f5..8acf642 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -57,6 +57,17 @@ AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
>       fi
>  ])
>  
> +AC_ARG_ENABLE(external_stacktrace,
> +     AC_HELP_STRING([--enable-external-stacktrace],
> +             [let system handle stack traces]))
> +if test "x${enable_external_stacktrace}" != xyes
> +then
> +     EXT_STACKTRACE=FALSE
> +else
> +     EXT_STACKTRACE=TRUE
> +fi
> +AC_SUBST(EXT_STACKTRACE)
> +
>  AC_ARG_ENABLE(threads,
>       AC_HELP_STRING([--enable-threads], [enable threading support]),
>                       [enable_threads=${enableval}], [enable_threads="no"])
> diff --git a/src/log.c b/src/log.c
> index 7d1896c..d82bcdd 100644
> --- a/src/log.c
> +++ b/src/log.c
> @@ -226,6 +226,9 @@ static void signal_setup(sighandler_t handler)
>       struct sigaction sa;
>       sigset_t mask;
>  
> +     if (EXTERNAL_STACK_TRACE == TRUE)
> +             return;
> +

this is so awfully hackish, that I do not like it at all. We need to
figure out a more clean solution.

Maybe it would be better to create command line option for this. In
addition this should be done across daemons. Not just only for ConnMan.

Regards

Marcel


_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to