From 2ba7c200c6c4844b63f8f707a6f04017661f16ca Mon Sep 17 00:00:00 2001 From: Jose Bollo Date: Mon, 18 Feb 2019 13:13:56 +0100 Subject: [PATCH] Improve setting of options Change-Id: Idbadb9b7b801cb61d527addb5d3137aeb4cf6311 Signed-off-by: Jose Bollo --- CMakeLists.txt | 14 +++++++----- src/CMakeLists.txt | 62 ++++++++++++++++++++++++++++----------------------- src/afb-api-dbus.c | 2 +- src/afb-api-dbus.h | 4 +++- src/afb-api-so-v1.c | 2 +- src/afb-api-so-v1.h | 4 ++++ src/afb-api-so-vdyn.c | 2 +- src/afb-api-so-vdyn.h | 4 ++++ src/afb-api-so.c | 8 +++---- src/afb-args.c | 14 ++++++------ src/afb-export.c | 30 ++++++++++++------------- src/afb-export.h | 2 +- src/afb-supervision.c | 2 +- src/main-afb-daemon.c | 10 ++++----- src/sig-monitor.c | 40 ++++++++++++++++----------------- 15 files changed, 109 insertions(+), 91 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5646309..6a8bfaaa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,12 +39,14 @@ INCLUDE(CTest) ########################################################################### # possible settings -set(AGL_DEVEL OFF CACHE BOOL "Activates developping features") -set(INCLUDE_MONITORING OFF CACHE BOOL "Activates installation of monitoring") -set(INCLUDE_SUPERVISOR OFF CACHE BOOL "Activates installation of supervisor") -set(INCLUDE_DBUS_TRANSPARENCY OFF CACHE BOOL "Allows API transparency over DBUS") -set(INCLUDE_LEGACY_BINDING_V1 OFF CACHE BOOL "Includes the legacy Binding API version 1") -set(INCLUDE_LEGACY_BINDING_VDYN OFF CACHE BOOL "Includes the legacy Binding API version dynamic") +option(AGL_DEVEL "Activates developping features" OFF) +option(INCLUDE_MONITORING "Activates installation of monitoring" OFF) + +option(INCLUDE_SUPERVISOR "Activates installation of supervisor" OFF) +option(INCLUDE_DBUS_TRANSPARENCY "Allows API transparency over DBUS" OFF) +option(INCLUDE_LEGACY_BINDING_V1 "Includes the legacy Binding API version 1" OFF) +option(INCLUDE_LEGACY_BINDING_VDYN "Includes the legacy Binding API version dynamic" OFF) + set(AFS_SUPERVISION_SOCKET "@urn:AGL:afs:supervision:socket" CACHE STRING "Internal socket for supervision") set(AFS_SUPERVISOR_PORT 1619 CACHE STRING "Port of service for the supervisor") set(AFS_SUPERVISOR_TOKEN HELLO CACHE STRING "Secret token for the supervisor") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4ef001f0..58870aa4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,26 +26,49 @@ ADD_DEFINITIONS(-DINFER_EXTENSION) ############################################################################ # TODO: improve below setting -option(USE_SIG_MONITOR_DUMPSTACK "activate dump stack on error" ON) -option(USE_SIG_MONITOR_SIGNALS "activate handling of signals" ON) -option(USE_SIG_MONITOR_FOR_CALL "activate monitoring of calls" ON) -option(USE_SIG_MONITOR_TIMERS "activate monitoring of call expiration" ON) -option(WITH_AFB_HOOK "include hooking" ON) -option(WITH_AFB_TRACE "include monitoring trace" ON) +option(WITH_SIG_MONITOR_DUMPSTACK "activate dump stack on error" ON) +option(WITH_SIG_MONITOR_SIGNALS "activate handling of signals" ON) +option(WITH_SIG_MONITOR_FOR_CALL "activate monitoring of calls" ON) +option(WITH_SIG_MONITOR_TIMERS "activate monitoring of call expiration" ON) +option(WITH_AFB_HOOK "include hooking" ON) +option(WITH_AFB_TRACE "include monitoring trace" ON) +option(WITH_SUPERVISOR "Activates installation of supervisor" OFF) +option(WITH_DBUS_TRANSPARENCY "Allows API transparency over DBUS" OFF) +option(WITH_LEGACY_BINDING_V1 "Includes the legacy Binding API version 1" OFF) +option(WITH_LEGACY_BINDING_VDYN "Includes the legacy Binding API version dynamic" OFF) + +if(INCLUDE_SUPERVISOR) + set(WITH_SUPERVISOR ON) +endif() +if(INCLUDE_DBUS_TRANSPARENCY) + set(WITH_DBUS_TRANSPARENCY ON) +endif() +if(INCLUDE_LEGACY_BINDING_V1) + set(WITH_LEGACY_BINDING_V1 ON) +endif() +if(INCLUDE_LEGACY_BINDING_VDYN) + set(WITH_LEGACY_BINDING_VDYN ON) +endif() add_definitions( - -DUSE_SIG_MONITOR_DUMPSTACK=$ - -DUSE_SIG_MONITOR_SIGNALS=$ - -DUSE_SIG_MONITOR_FOR_CALL=$ - -DUSE_SIG_MONITOR_TIMERS=$ + -DWITH_SIG_MONITOR_DUMPSTACK=$ + -DWITH_SIG_MONITOR_SIGNALS=$ + -DWITH_SIG_MONITOR_FOR_CALL=$ + -DWITH_SIG_MONITOR_TIMERS=$ -DWITH_AFB_HOOK=$ -DWITH_AFB_TRACE=$ + -DWITH_LEGACY_BINDING_V1=$ + -DWITH_LEGACY_BINDING_VDYN=$ + -DWITH_DBUS_TRANSPARENCY=$ + -DWITH_SUPERVISION=$ ) ############################################################################ SET(AFB_LIB_SOURCES afb-api.c + afb-api-dbus.c afb-api-so.c + afb-api-so-v1.c afb-api-so-v2.c afb-api-so-v3.c afb-api-so-vdyn.c @@ -75,6 +98,7 @@ SET(AFB_LIB_SOURCES afb-session.c afb-socket.c afb-stub-ws.c + afb-supervision.c afb-trace.c afb-websock.c afb-ws-client.c @@ -100,24 +124,6 @@ SET(AFB_LIB_SOURCES wrap-json.c ) -IF(INCLUDE_LEGACY_BINDING_V1) - ADD_DEFINITIONS(-DWITH_LEGACY_BINDING_V1) - SET(AFB_LIB_SOURCES ${AFB_LIB_SOURCES} afb-api-so-v1.c) -ENDIF(INCLUDE_LEGACY_BINDING_V1) -IF(INCLUDE_LEGACY_BINDING_VDYN) - ADD_DEFINITIONS(-DWITH_LEGACY_BINDING_VDYN) - SET(AFB_LIB_SOURCES ${AFB_LIB_SOURCES} afb-api-so-vdyn.c) -ENDIF(INCLUDE_LEGACY_BINDING_VDYN) - -IF(INCLUDE_DBUS_TRANSPARENCY) - ADD_DEFINITIONS(-DWITH_DBUS_TRANSPARENCY) - SET(AFB_LIB_SOURCES ${AFB_LIB_SOURCES} afb-api-dbus.c) -ENDIF() -IF(INCLUDE_SUPERVISOR) - ADD_DEFINITIONS(-DWITH_SUPERVISION) - SET(AFB_LIB_SOURCES ${AFB_LIB_SOURCES} afb-supervision.c) -ENDIF() - ADD_LIBRARY(afb-lib STATIC ${AFB_LIB_SOURCES}) ########################################### diff --git a/src/afb-api-dbus.c b/src/afb-api-dbus.c index dccfbbd8..562465e2 100644 --- a/src/afb-api-dbus.c +++ b/src/afb-api-dbus.c @@ -15,7 +15,7 @@ * limitations under the License. */ -#if defined(WITH_DBUS_TRANSPARENCY) +#if WITH_DBUS_TRANSPARENCY #define _GNU_SOURCE diff --git a/src/afb-api-dbus.h b/src/afb-api-dbus.h index a85fe92a..cda97c0c 100644 --- a/src/afb-api-dbus.h +++ b/src/afb-api-dbus.h @@ -18,10 +18,12 @@ #pragma once +#if WITH_DBUS_TRANSPARENCY + struct afb_req_itf; extern int afb_api_dbus_add_client(const char *path, struct afb_apiset *declare_set, struct afb_apiset *call_set); extern int afb_api_dbus_add_server(const char *path, struct afb_apiset *declare_set, struct afb_apiset *call_set); - +#endif diff --git a/src/afb-api-so-v1.c b/src/afb-api-so-v1.c index 29accd5d..5ab2c4c4 100644 --- a/src/afb-api-so-v1.c +++ b/src/afb-api-so-v1.c @@ -15,7 +15,7 @@ * limitations under the License. */ -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 #define _GNU_SOURCE diff --git a/src/afb-api-so-v1.h b/src/afb-api-so-v1.h index baf49649..4e167512 100644 --- a/src/afb-api-so-v1.h +++ b/src/afb-api-so-v1.h @@ -18,6 +18,8 @@ #pragma once +#if WITH_LEGACY_BINDING_V1 + struct afb_apiset; struct afb_binding_v1; struct afb_xreq; @@ -27,3 +29,5 @@ extern int afb_api_so_v1_add(const char *path, void *handle, struct afb_apiset * extern void afb_api_so_v1_process_call(struct afb_binding_v1 *binding, struct afb_xreq *xreq); extern struct json_object *afb_api_so_v1_make_description_openAPIv3(struct afb_binding_v1 *binding, const char *apiname); + +#endif diff --git a/src/afb-api-so-vdyn.c b/src/afb-api-so-vdyn.c index c7890035..6be16b95 100644 --- a/src/afb-api-so-vdyn.c +++ b/src/afb-api-so-vdyn.c @@ -15,7 +15,7 @@ * limitations under the License. */ -#if defined(WITH_LEGACY_BINDING_VDYN) +#if WITH_LEGACY_BINDING_VDYN #define _GNU_SOURCE diff --git a/src/afb-api-so-vdyn.h b/src/afb-api-so-vdyn.h index 9735dac2..1188ad8f 100644 --- a/src/afb-api-so-vdyn.h +++ b/src/afb-api-so-vdyn.h @@ -18,6 +18,10 @@ #pragma once +#if WITH_LEGACY_BINDING_VDYN + struct afb_apiset; extern int afb_api_so_vdyn_add(const char *path, void *handle, struct afb_apiset *declare_set, struct afb_apiset * call_set); + +#endif diff --git a/src/afb-api-so.c b/src/afb-api-so.c index 9b28e1e3..11088b1c 100644 --- a/src/afb-api-so.c +++ b/src/afb-api-so.c @@ -30,10 +30,10 @@ #include "verbose.h" #include "sig-monitor.h" -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 # include "afb-api-so-v1.h" #endif -#if defined(WITH_LEGACY_BINDING_VDYN) +#if WITH_LEGACY_BINDING_VDYN # include "afb-api-so-vdyn.h" #endif @@ -100,7 +100,7 @@ static int load_binding(const char *path, int force, struct afb_apiset *declare_ if (rc) return 0; /* yes version 2 */ -#if defined(WITH_LEGACY_BINDING_VDYN) +#if WITH_LEGACY_BINDING_VDYN /* try the version dyn */ rc = afb_api_so_vdyn_add(path, handle, declare_set, call_set); if (rc < 0) { @@ -116,7 +116,7 @@ static int load_binding(const char *path, int force, struct afb_apiset *declare_ } #endif -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 /* try the version 1 */ rc = afb_api_so_v1_add(path, handle, declare_set, call_set); if (rc < 0) { diff --git a/src/afb-args.c b/src/afb-args.c index 05a88655..2af77f37 100644 --- a/src/afb-args.c +++ b/src/afb-args.c @@ -109,7 +109,7 @@ #endif #define SET_TRAP_FAULTS 27 #define ADD_CALL 28 -#if defined(WITH_DBUS_TRANSPARENCY) +#if WITH_DBUS_TRANSPARENCY # define ADD_DBUS_CLIENT 30 # define ADD_DBUS_SERVICE 31 #endif @@ -185,7 +185,7 @@ static struct option_desc optdefs[] = { {GET_VERSION, 0, "version", "Display version and copyright"}, {GET_HELP, 0, "help", "Display this help"}, -#if defined(WITH_DBUS_TRANSPARENCY) +#if WITH_DBUS_TRANSPARENCY {ADD_DBUS_CLIENT, 1, "dbus-client", "Bind to an afb service through dbus"}, {ADD_DBUS_SERVICE, 1, "dbus-server", "Provide an afb service through dbus"}, #endif @@ -335,7 +335,7 @@ static void printVersion(FILE * file) "\n" " AGL Framework Binder [AFB %s] " -#if defined(WITH_DBUS_TRANSPARENCY) +#if WITH_DBUS_TRANSPARENCY "+" #else "-" @@ -348,7 +348,7 @@ static void printVersion(FILE * file) "-" #endif "MONITOR " -#if defined(WITH_SUPERVISION) +#if WITH_SUPERVISION "+" #else "-" @@ -370,13 +370,13 @@ static void printVersion(FILE * file) "TRACE " "[BINDINGS " -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 "+" #else "-" #endif "V1 " -#if defined(WITH_LEGACY_BINDING_VDYN) +#if WITH_LEGACY_BINDING_VDYN "+" #else "-" @@ -814,7 +814,7 @@ static void parse_arguments_inner(int argc, char **argv, struct json_object *con config_set_optstr(config, optid); break; -#if defined(WITH_DBUS_TRANSPARENCY) +#if WITH_DBUS_TRANSPARENCY case ADD_DBUS_CLIENT: case ADD_DBUS_SERVICE: #endif diff --git a/src/afb-export.c b/src/afb-export.c index 5b0975dc..d0cabf6e 100644 --- a/src/afb-export.c +++ b/src/afb-export.c @@ -33,7 +33,7 @@ #include "afb-api.h" #include "afb-apiset.h" -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 #include "afb-api-so-v1.h" #endif #include "afb-api-so-v2.h" @@ -65,7 +65,7 @@ enum afb_api_version { Api_Version_None = 0, -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 Api_Version_1 = 1, #endif Api_Version_2 = 2, @@ -137,7 +137,7 @@ struct afb_export /* internal descriptors */ union { -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 struct afb_binding_v1 *v1; #endif const struct afb_binding_v2 *v2; @@ -146,7 +146,7 @@ struct afb_export /* start function */ union { -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 int (*v1)(struct afb_service_x1); #endif int (*v2)(); @@ -159,7 +159,7 @@ struct afb_export /* exported data */ union { -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 struct afb_binding_interface_v1 v1; #endif struct afb_binding_data_v2 *v2; @@ -1300,7 +1300,7 @@ static void set_interfaces(struct afb_export *export) export->api.itf = export->hookditf|export->hooksvc ? &hooked_api_x3_itf : &api_x3_itf; switch (export->version) { -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 case Api_Version_1: export->export.v1.daemon.itf = export->hookditf ? &hooked_daemon_itf : &daemon_itf; break; @@ -1315,7 +1315,7 @@ static void set_interfaces(struct afb_export *export) export->api.itf = &api_x3_itf; switch (export->version) { -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 case Api_Version_1: export->export.v1.daemon.itf = &daemon_itf; break; @@ -1416,7 +1416,7 @@ struct afb_export *afb_export_create_none_for_path( return export; } -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 struct afb_export *afb_export_create_v1(struct afb_apiset *declare_set, struct afb_apiset *call_set, const char *apiname, @@ -1530,7 +1530,7 @@ int afb_export_handle_events_v12(struct afb_export *export, void (*on_event)(con { /* check version */ switch (export->version) { -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 case Api_Version_1: #endif case Api_Version_2: @@ -1572,7 +1572,7 @@ int afb_export_handle_init_v3(struct afb_export *export, int (*oninit)(struct af return 0; } -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 /* * Starts a new service (v1) */ @@ -1599,7 +1599,7 @@ void afb_export_logmask_set(struct afb_export *export, int mask) { export->api.logmask = mask; switch (export->version) { -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 case Api_Version_1: export->export.v1.verbosity = verbosity_from_mask(mask); break; #endif case Api_Version_2: export->export.v2->verbosity = verbosity_from_mask(mask); break; @@ -1643,7 +1643,7 @@ static void do_init(int sig, void *closure) else { export = init->export; switch (export->version) { -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 case Api_Version_1: rc = export->init.v1 ? export->init.v1( (struct afb_service_x1){ @@ -1691,7 +1691,7 @@ int afb_export_start(struct afb_export *export) /* set event handling */ switch (export->version) { -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 case Api_Version_1: #endif case Api_Version_2: @@ -1742,7 +1742,7 @@ static void api_call_cb(void *closure, struct afb_xreq *xreq) xreq->request.api = to_api_x3(export); switch (export->version) { -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 case Api_Version_1: afb_api_so_v1_process_call(export->desc.v1, xreq); break; @@ -1765,7 +1765,7 @@ static struct json_object *api_describe_cb(void *closure) struct json_object *result; switch (export->version) { -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 case Api_Version_1: result = afb_api_so_v1_make_description_openAPIv3(export->desc.v1, export->api.apiname); break; diff --git a/src/afb-export.h b/src/afb-export.h index e8b9a9d4..cb65020a 100644 --- a/src/afb-export.h +++ b/src/afb-export.h @@ -118,7 +118,7 @@ extern struct afb_api_x3 *afb_export_to_api_x3(struct afb_export *export); extern void afb_export_update_hooks(struct afb_export *export); #endif -#if defined(WITH_LEGACY_BINDING_V1) +#if WITH_LEGACY_BINDING_V1 struct afb_service_x1; struct afb_binding_interface_v1; diff --git a/src/afb-supervision.c b/src/afb-supervision.c index 5790c3ad..1575ae29 100644 --- a/src/afb-supervision.c +++ b/src/afb-supervision.c @@ -15,7 +15,7 @@ * limitations under the License. */ -#if defined(WITH_SUPERVISION) +#if WITH_SUPERVISION #define _GNU_SOURCE diff --git a/src/main-afb-daemon.c b/src/main-afb-daemon.c index c2a53513..a85ffc0a 100644 --- a/src/main-afb-daemon.c +++ b/src/main-afb-daemon.c @@ -43,7 +43,7 @@ #include "afb-apiset.h" #include "afb-autoset.h" #include "afb-api-so.h" -#if defined(WITH_DBUS_TRANSPARENCY) +#if WITH_DBUS_TRANSPARENCY # include "afb-api-dbus.h" #endif #include "afb-api-ws.h" @@ -60,7 +60,7 @@ #include "afb-hook-flags.h" #endif #include "afb-debug.h" -#if defined(WITH_SUPERVISION) +#if WITH_SUPERVISION # include "afb-supervision.h" #endif @@ -805,7 +805,7 @@ static void start(int signum, void *arg) ERROR("failed to setup monitor"); goto error; } -#if defined(WITH_SUPERVISION) +#if WITH_SUPERVISION if (afb_supervision_init(main_apiset, main_config) < 0) { ERROR("failed to setup supervision"); goto error; @@ -839,7 +839,7 @@ static void start(int signum, void *arg) apiset_start_list("ldpaths", afb_api_so_add_pathset_fails, "the binding path set"); apiset_start_list("weak-ldpaths", afb_api_so_add_pathset_nofails, "the weak binding path set"); apiset_start_list("auto-api", afb_autoset_add_any, "the automatic api path set"); -#if defined(WITH_DBUS_TRANSPARENCY) +#if WITH_DBUS_TRANSPARENCY apiset_start_list("dbus-client", afb_api_dbus_add_client, "the afb-dbus client"); #endif apiset_start_list("ws-client", afb_api_ws_add_client_weak, "the afb-websocket client"); @@ -856,7 +856,7 @@ static void start(int signum, void *arg) /* export started apis */ apiset_start_list("ws-server", afb_api_ws_add_server, "the afb-websocket service"); -#if defined(WITH_DBUS_TRANSPARENCY) +#if WITH_DBUS_TRANSPARENCY apiset_start_list("dbus-server", afb_api_dbus_add_server, "the afb-dbus service"); #endif diff --git a/src/sig-monitor.c b/src/sig-monitor.c index 954dcf8b..f15f214e 100644 --- a/src/sig-monitor.c +++ b/src/sig-monitor.c @@ -22,33 +22,33 @@ *******************************************************************************/ /* controls whether to dump stack or not */ -#if !defined(USE_SIG_MONITOR_DUMPSTACK) -# define USE_SIG_MONITOR_DUMPSTACK 1 +#if !defined(WITH_SIG_MONITOR_DUMPSTACK) +# define WITH_SIG_MONITOR_DUMPSTACK 1 #endif /* control whether to monitor signals */ -#if !defined(USE_SIG_MONITOR_SIGNALS) -# define USE_SIG_MONITOR_SIGNALS 1 +#if !defined(WITH_SIG_MONITOR_SIGNALS) +# define WITH_SIG_MONITOR_SIGNALS 1 #endif /* controls whether to monitor calls */ -#if !defined(USE_SIG_MONITOR_FOR_CALL) -# define USE_SIG_MONITOR_FOR_CALL 1 +#if !defined(WITH_SIG_MONITOR_FOR_CALL) +# define WITH_SIG_MONITOR_FOR_CALL 1 #endif /* control whether to monitor timers */ -#if !defined(USE_SIG_MONITOR_TIMERS) -# define USE_SIG_MONITOR_TIMERS 1 +#if !defined(WITH_SIG_MONITOR_TIMERS) +# define WITH_SIG_MONITOR_TIMERS 1 #endif -#if !USE_SIG_MONITOR_SIGNALS -# undef USE_SIG_MONITOR_FOR_CALL -# define USE_SIG_MONITOR_FOR_CALL 0 +#if !WITH_SIG_MONITOR_SIGNALS +# undef WITH_SIG_MONITOR_FOR_CALL +# define WITH_SIG_MONITOR_FOR_CALL 0 #endif -#if !USE_SIG_MONITOR_FOR_CALL -# undef USE_SIG_MONITOR_TIMERS -# define USE_SIG_MONITOR_TIMERS 0 +#if !WITH_SIG_MONITOR_FOR_CALL +# undef WITH_SIG_MONITOR_TIMERS +# define WITH_SIG_MONITOR_TIMERS 0 #endif /******************************************************************************/ @@ -63,7 +63,7 @@ #include "verbose.h" /******************************************************************************/ -#if !USE_SIG_MONITOR_DUMPSTACK +#if !WITH_SIG_MONITOR_DUMPSTACK static inline void dumpstack(int crop, int signum) {} @@ -109,7 +109,7 @@ static void dumpstack(int crop, int signum) #endif /******************************************************************************/ -#if !USE_SIG_MONITOR_TIMERS +#if !WITH_SIG_MONITOR_TIMERS static inline int timeout_create() { return 0; } static inline int timeout_arm(int timeout) { return 0; } @@ -198,7 +198,7 @@ static inline void timeout_delete() } #endif /******************************************************************************/ -#if !USE_SIG_MONITOR_FOR_CALL +#if !WITH_SIG_MONITOR_FOR_CALL static inline void monitor_raise(int signum) {} @@ -240,7 +240,7 @@ static inline void monitor_raise(int signum) } #endif /******************************************************************************/ -#if !USE_SIG_MONITOR_SIGNALS +#if !WITH_SIG_MONITOR_SIGNALS static inline int enable_signal_handling() { return 0; } @@ -294,7 +294,7 @@ static void safe_exit(int code) exit(code); } -#if !USE_SIG_MONITOR_DUMPSTACK +#if !WITH_SIG_MONITOR_DUMPSTACK static inline void safe_dumpstack(int crop, int signum) {} #define in_safe_dumpstack (0) @@ -387,7 +387,7 @@ void sig_monitor_clean_timeouts() void sig_monitor(int timeout, void (*function)(int sig, void*), void *arg) { -#if USE_SIG_MONITOR_SIGNALS && USE_SIG_MONITOR_FOR_CALL +#if WITH_SIG_MONITOR_SIGNALS && WITH_SIG_MONITOR_FOR_CALL if (enabled) monitor(timeout, function, arg); else -- 2.16.6