diff options
Diffstat (limited to 'src/core/wee-util.c')
-rw-r--r-- | src/core/wee-util.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/core/wee-util.c b/src/core/wee-util.c index 68270b554..a0976d9a2 100644 --- a/src/core/wee-util.c +++ b/src/core/wee-util.c @@ -465,6 +465,28 @@ util_signal_search (const char *name) } /* + * Gets a signal name with a signal number; only some commonly used signal + * names are supported here (see declaration of util_signals[]). + * + * Returns the pointer to the signal name, NULL if not found. + */ + +const char * +util_signal_search_number (int signal_number) +{ + int i; + + for (i = 0; util_signals[i].name; i++) + { + if (util_signals[i].signal == signal_number) + return util_signals[i].name; + } + + /* signal not found */ + return NULL; +} + +/* * Catches a system signal. */ |