diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-07 09:44:05 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-07 09:44:05 -0700 |
commit | 7cbe71b74d3bd8b8de8f6838934eaaa5365c4e61 (patch) | |
tree | 765e41a7b538a3600907cadf1de90ab82d45f241 /signal.c | |
parent | cd8e03d083ec0aae5e7420765404d306f9a347cb (diff) | |
download | txr-7cbe71b74d3bd8b8de8f6838934eaaa5365c4e61.tar.gz txr-7cbe71b74d3bd8b8de8f6838934eaaa5365c4e61.tar.bz2 txr-7cbe71b74d3bd8b8de8f6838934eaaa5365c4e61.zip |
kill function returns boolean rather than integer.
* signal.c (kill_wrap): Return boolean indication of success,
with compatibility to previous behavior.
* txr.1: Document return value of kill, and put in
compatibility note.
Diffstat (limited to 'signal.c')
-rw-r--r-- | signal.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -42,6 +42,7 @@ #include "signal.h" #include "unwind.h" #include "eval.h" +#include "txr.h" #define MAX_SIG 32 @@ -113,7 +114,10 @@ static void sig_handler(int sig) static val kill_wrap(val pid, val sig) { cnum p = c_num(pid), s = c_num(default_arg(sig, num_fast(SIGTERM))); - return num(kill(p, s)); + int res = kill(p, s); + if (opt_compat && opt_compat <= 114) + return num(res); + return tnil(res == 0); } static val raise_wrap(val sig) |