From 26e6b505a5e6f0b65e4f463250935e532ed37eed Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Wed, 23 Jan 2019 10:29:42 +0900 Subject: [PATCH] event/rpc: Use spdk_strtol to clarify if signal is specified by name Change-Id: I550802d70f415d24284a1afc43bdc83d43582355 Signed-off-by: Shuhei Matsumoto Reviewed-on: https://review.gerrithub.io/c/441640 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: wuzhouhui Reviewed-by: Ben Walker Reviewed-by: Changpeng Liu --- lib/event/rpc/app_rpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/event/rpc/app_rpc.c b/lib/event/rpc/app_rpc.c index 95cb0d2a3..9cf192119 100644 --- a/lib/event/rpc/app_rpc.c +++ b/lib/event/rpc/app_rpc.c @@ -35,6 +35,7 @@ #include "spdk/event.h" #include "spdk/rpc.h" +#include "spdk/string.h" #include "spdk/util.h" #include "spdk_internal/log.h" @@ -80,7 +81,7 @@ spdk_rpc_kill_instance(struct spdk_jsonrpc_request *request, } sig_count = SPDK_COUNTOF(signals); - signal = atoi(req.sig_name); + signal = spdk_strtol(req.sig_name, 10); for (i = 0 ; i < sig_count; i++) { if (strcmp(req.sig_name, signals[i].signal_string) == 0 || signal == signals[i].signal) {