From b826afe8f96b2c7f286f6ca6071c92019677d91a Mon Sep 17 00:00:00 2001 From: Shell Date: Fri, 22 Sep 2023 15:06:07 +0800 Subject: [PATCH] [smart] fix of cmd_kill (#8071) Signed-off-by: Shell --- components/lwp/lwp_pid.c | 2 +- components/lwp/lwp_signal.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lwp/lwp_pid.c b/components/lwp/lwp_pid.c index 7c00174762..9b5ecf46e5 100644 --- a/components/lwp/lwp_pid.c +++ b/components/lwp/lwp_pid.c @@ -857,7 +857,7 @@ MSH_CMD_EXPORT(list_process, list process); static void cmd_kill(int argc, char** argv) { int pid; - int sig = 0; + int sig = SIGKILL; if (argc < 2) { diff --git a/components/lwp/lwp_signal.c b/components/lwp/lwp_signal.c index ffba9e27b0..d58a8b64d2 100644 --- a/components/lwp/lwp_signal.c +++ b/components/lwp/lwp_signal.c @@ -690,7 +690,7 @@ rt_err_t lwp_signal_kill(struct rt_lwp *lwp, long signo, long code, long value) /** must be able to be suspended */ RT_DEBUG_SCHEDULER_AVAILABLE(RT_TRUE); - if (!lwp || signo < 0 || signo >= _LWP_NSIG) + if (!lwp || signo <= 0 || signo > _LWP_NSIG) { ret = -RT_EINVAL; }