Taught multiwatch to send the correct signal when using --signal

When the --signal flag was enabled, multiwatch was sending the
index of signal in the sig_actions array instead of the correct
signal number. So, when multiwatch was told to send a SIGTERM,
the application was actually being sent a SIGQUIT, which caused
the application to coredump as ordered.

The fix is to change the loop to return the signal number
stored at the index.
master
Tyler Stubenvoll 2018-07-21 13:59:10 -07:00
parent d3a960fbe0
commit bdd50b7910
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ static gint signame2num(const char *name) {
for (i = 0; signal_actions[i].signame; i++) {
if (0 == strcmp(signal_actions[i].signame, name)) {
return i;
return signal_actions[i].signum;
}
}