aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Stubenvoll <tstubenv@fastmail.fm>2018-07-21 13:59:10 -0700
committerTyler Stubenvoll <tstubenv@fastmail.fm>2018-07-21 13:59:10 -0700
commitbdd50b7910ebfd04f70e39cb688e3a4851505ac4 (patch)
tree1078a618b47b6488cfcffcf1d143705ec89cc322
parentd3a960fbe01b237850379dcfe9f3dc6d638c39a2 (diff)
downloadmultiwatch-master.tar.gz
multiwatch-master.zip
Taught multiwatch to send the correct signal when using --signalHEADmaster
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.
-rw-r--r--multiwatch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/multiwatch.c b/multiwatch.c
index 30dcb97..1dcdf2e 100644
--- a/multiwatch.c
+++ b/multiwatch.c
@@ -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;
}
}