aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2020-06-09 14:48:02 +0200
committerAngelo Mantellini <angelo.mantellini@cisco.com>2020-06-15 11:43:30 +0200
commit9e2c045d6118ef264d6cf8fc655b72d7c4c403dc (patch)
treed4156335f5ea69064e817b7c6536e0200c6421af /hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
parenta84ff82bb37ac53f20639d6e5e7f19d002459f31 (diff)
[HICN-626] Return output from libhicnlight
Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com> Change-Id: I2351ce4dcefa1311fa09049f87e8317c8fe449f4
Diffstat (limited to 'hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c')
-rw-r--r--hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c b/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
index 8f56dc60a..31b9674ca 100644
--- a/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
+++ b/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c
@@ -340,6 +340,9 @@ int main(int argc, char *argv[]) {
mainState.controlState =
controlState_Create(&mainState, _writeAndReadMessage, true,
server_ip, server_port);
+ if (mainState.controlState == NULL) {
+ exit(EXIT_FAILURE);
+ }
controlState_RegisterCommand(mainState.controlState,
controlRoot_HelpCreate(mainState.controlState));
@@ -348,7 +351,9 @@ int main(int argc, char *argv[]) {
if (parcList_Size(commands) > 0) {
controlState_SetInteractiveFlag(mainState.controlState, false);
- controlState_DispatchCommand(mainState.controlState, commands);
+ char output[8192];
+ controlState_DispatchCommand(mainState.controlState, commands, output, sizeof(output));
+ printf("%s", output);
char **commandOutputMain =
controlState_GetCommandOutput(mainState.controlState);
if (commandOutputMain != NULL && commandOutputLen > 0) {