diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-07-28 09:54:20 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-08-02 13:52:39 +0200 |
commit | 444bae110b04dce8d3e05a392716179f4a291a5e (patch) | |
tree | 48a34b2c6384aba1d7ee3362ccc8d98ba22776a8 | |
parent | df383333a53e62234b8999269834e08291326be7 (diff) |
debug: allow break after wait
Change-Id: I634abe531606a30ba241c85bf650589c5f0ea4ca
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r-- | src/afb-debug.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/afb-debug.c b/src/afb-debug.c index 228f710e..e7a5c643 100644 --- a/src/afb-debug.c +++ b/src/afb-debug.c @@ -82,15 +82,7 @@ void afb_debug(const char *key) struct sigaction sa, psa; sigset_t ss, oss; - if (has_key(key, secure_getenv(key_env_break))) { - NOTICE("DEBUG BREAK before %s", key); - memset(&sa, 0, sizeof sa); - sa.sa_handler = handler; - sigaction(SIGINT, &sa, &psa); - raise(SIGINT); - sigaction(SIGINT, &psa, NULL); - NOTICE("DEBUG BREAK after %s", key); - } else if (has_key(key, secure_getenv(key_env_wait))) { + if (has_key(key, secure_getenv(key_env_wait))) { NOTICE("DEBUG WAIT before %s", key); sigfillset(&ss); sigdelset(&ss, SIGINT); @@ -107,6 +99,15 @@ void afb_debug(const char *key) sigprocmask(SIG_SETMASK, &oss, NULL); NOTICE("DEBUG WAIT after %s", key); } + if (has_key(key, secure_getenv(key_env_break))) { + NOTICE("DEBUG BREAK before %s", key); + memset(&sa, 0, sizeof sa); + sa.sa_handler = handler; + sigaction(SIGINT, &sa, &psa); + raise(SIGINT); + sigaction(SIGINT, &psa, NULL); + NOTICE("DEBUG BREAK after %s", key); + } } #endif |