From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tama50.ecl.ntt.co.jp (tama50.ecl.ntt.co.jp [129.60.39.147]) by dpdk.org (Postfix) with ESMTP id 3D3774CC7 for ; Thu, 25 Oct 2018 07:19:57 +0200 (CEST) Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w9P5JsRn022728; Thu, 25 Oct 2018 14:19:54 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 8986FEA7CFC; Thu, 25 Oct 2018 14:19:54 +0900 (JST) Received: from localhost.localdomain (unknown [129.60.13.51]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 702BDEA7CEC; Thu, 25 Oct 2018 14:19:54 +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:19:41 +0900 Message-Id: <20181025051943.17129-4-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20181025051943.17129-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20181025051943.17129-1-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 3/5] spp_vm: 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:19:57 -0000 From: Yasufumi Ogawa This patch is to fix error of receiving data of NfvProc in spp-ctl as previous commit for spp_nfv. Signed-off-by: Yasufumi Ogawa --- src/vm/main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/vm/main.c b/src/vm/main.c index 1d7d83a..050af3f 100644 --- a/src/vm/main.c +++ b/src/vm/main.c @@ -609,6 +609,7 @@ main(int argc, char *argv[]) int connected = 0; char str[MSG_SIZE]; int ret; + int flg_exit; // used as res of parse_command() to exit if -1 int i; /* initialise the system */ @@ -651,13 +652,14 @@ main(int argc, char *argv[]) RTE_LOG(DEBUG, APP, "Received string: %s\n", str); - ret = parse_command(str); - if (ret < 0) /* terminate process if exit is called */ - break; + flg_exit = parse_command(str); - /*Send the message back to client*/ + /* 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