From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id 6231E293B for ; Thu, 25 Oct 2018 07:20:37 +0200 (CEST) Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w9P5KaBc007548; Thu, 25 Oct 2018 14:20:36 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 1A424EA7CFC; Thu, 25 Oct 2018 14:20:36 +0900 (JST) Received: from localhost.localdomain (unknown [129.60.13.51]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id F2E3CEA7CEC; Thu, 25 Oct 2018 14:20:35 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Thu, 25 Oct 2018 14:20:19 +0900 Message-Id: <20181025052023.17190-2-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20181025052023.17190-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20181025052023.17190-1-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 1/5] primary: chage to return msg of exit command X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 05:20:38 -0000 From: Yasufumi Ogawa This patch is to fix error of receiving data of PrimaryProc in spp-ctl. Spp_primary returns no message after exit command while spp-ctl expects to get any of message as a result. To fix, change to return empty message. Signed-off-by: Yasufumi Ogawa --- src/primary/main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/primary/main.c b/src/primary/main.c index 33f4143..d991bca 100644 --- a/src/primary/main.c +++ b/src/primary/main.c @@ -383,6 +383,7 @@ main(int argc, char *argv[]) int sock = SOCK_RESET; int connected = 0; char str[MSG_SIZE]; + int flg_exit; // used as res of parse_command() to exit if -1 int ret; /* Register signals */ @@ -413,13 +414,14 @@ main(int argc, char *argv[]) RTE_LOG(DEBUG, APP, "Received string: %s\n", str); - ret = parse_command(str); - if (ret < 0) - break; + flg_exit = parse_command(str); /* Send the message back to client */ ret = do_send(&connected, &sock, str); - if (ret < 0) + + if (flg_exit < 0) /* terminate process if exit is called */ + break; + else if (ret < 0) continue; } -- 2.7.4