Module: xenomai-2.6 Branch: master Commit: 560c26eb2f673ab441d228770afc76f23ca756d6 URL: http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=560c26eb2f673ab441d228770afc76f23ca756d6
Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org> Date: Thu Jun 16 13:04:19 2016 +0200 sigdebug: add SIGDEBUG_RESCNT_IMBALANCE --- examples/native/sigdebug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/native/sigdebug.c b/examples/native/sigdebug.c index e20714b..eeb45c5 100644 --- a/examples/native/sigdebug.c +++ b/examples/native/sigdebug.c @@ -34,7 +34,9 @@ static const char *reason_str[] = { [SIGDEBUG_MIGRATE_PRIOINV] = "affected by priority inversion", [SIGDEBUG_NOMLOCK] = "missing mlockall", [SIGDEBUG_WATCHDOG] = "runaway thread", + [SIGDEBUG_RESCNT_IMBALANCE] = "ressource count imbalance", }; +#define nr_reasons (sizeof(reason_str)/sizeof(reason_str[0])) void warn_upon_switch(int sig, siginfo_t *si, void *context) { @@ -43,7 +45,7 @@ void warn_upon_switch(int sig, siginfo_t *si, void *context) int nentries; printf("\nSIGDEBUG received, reason %d: %s\n", reason, - reason <= SIGDEBUG_WATCHDOG ? reason_str[reason] : "<unknown>"); + reason < nr_reasons ? reason_str[reason] : "<unknown>"); /* Dump a backtrace of the frame which caused the switch to secondary mode: */ nentries = backtrace(bt,sizeof(bt) / sizeof(bt[0])); _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git