This is an automated email from the ASF dual-hosted git repository.

protobits pushed a commit to branch releases/10.1
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/releases/10.1 by this push:
     new 4348d91  wireless/wapi/src/wapi.c: When executing a command return 
it's error code on failure.
4348d91 is described below

commit 4348d91d1356335483089c3865282d80f13bedcd
Author: Abdelatif Guettouche <[email protected]>
AuthorDate: Mon Apr 12 10:11:05 2021 +0200

    wireless/wapi/src/wapi.c: When executing a command return it's error code 
on failure.
    
    Signed-off-by: Abdelatif Guettouche <[email protected]>
---
 wireless/wapi/src/wapi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/wireless/wapi/src/wapi.c b/wireless/wapi/src/wapi.c
index cc8c28f..13d717b 100644
--- a/wireless/wapi/src/wapi.c
+++ b/wireless/wapi/src/wapi.c
@@ -1021,6 +1021,7 @@ int main(int argc, FAR char *argv[])
   FAR const struct wapi_command_s *wapicmd;
   int sock;
   int i;
+  int ret;
 
   /* Get the command */
 
@@ -1080,7 +1081,8 @@ int main(int argc, FAR char *argv[])
       return EXIT_FAILURE;
     }
 
-  if (wapicmd->handler(sock, argc - 2, argc == 2 ? NULL : &argv[2]) < 0)
+  ret = wapicmd->handler(sock, argc - 2, argc == 2 ? NULL : &argv[2]);
+  if (ret < 0)
     {
       WAPI_ERROR("ERROR: Process command (%s) failed.\n", cmdname);
     }
@@ -1088,5 +1090,5 @@ int main(int argc, FAR char *argv[])
   /* Close communication socket */
 
   close(sock);
-  return EXIT_SUCCESS;
+  return ret;
 }

Reply via email to