From 7cbe71b74d3bd8b8de8f6838934eaaa5365c4e61 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 7 Sep 2015 09:44:05 -0700 Subject: 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. --- signal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'signal.c') diff --git a/signal.c b/signal.c index e5649f7a..b5f8f464 100644 --- a/signal.c +++ b/signal.c @@ -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) -- cgit v1.2.3