[spp] [PATCH 3/5] spp_vm: chage to return msg of exit command
ogawa.yasufumi at lab.ntt.co.jp
ogawa.yasufumi at lab.ntt.co.jp
Thu Oct 25 07:19:41 CEST 2018
From: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
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 <ogawa.yasufumi at lab.ntt.co.jp>
---
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
More information about the spp
mailing list