This is an automated email from Gerrit.

Antonio Borneo ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/5661

-- gerrit

commit a9f3e4f4fffb55a5a9398b33e3f29d9a12ab6588
Author: Antonio Borneo <[email protected]>
Date:   Wed May 13 00:47:17 2020 +0200

    helper/command: fix check on value returned by jim API
    
    Either Jim_CreateCommand() and register_command_handler() return
    the jim error code JIM_OK/JIM_ERR.
    
    Fix the check and the initialization of retval.
    
    Change-Id: I3073c66764670128706ad979a43bb3edbbeb0ab0
    Signed-off-by: Antonio Borneo <[email protected]>

diff --git a/src/helper/command.c b/src/helper/command.c
index 14746a0..193867f 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -380,14 +380,14 @@ struct command *register_command(struct command_context 
*context,
        if (NULL == c)
                return NULL;
 
-       int retval = ERROR_OK;
+       int retval = JIM_OK;
        if (NULL != cr->jim_handler && NULL == parent) {
                retval = Jim_CreateCommand(context->interp, cr->name,
                                cr->jim_handler, NULL, NULL);
        } else if (NULL != cr->handler || NULL != parent)
                retval = register_command_handler(context, command_root(c));
 
-       if (ERROR_OK != retval) {
+       if (retval != JIM_OK) {
                unregister_command(context, parent, name);
                c = NULL;
        }

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to