Fix same -V version string

Restconf exit segv
This commit is contained in:
Olof hagsand 2024-02-17 22:04:21 +01:00
parent 6ff1588397
commit 3b0b734de1
11 changed files with 11 additions and 10 deletions

View file

@ -569,7 +569,7 @@ main(int argc,
help = 1;
break;
case 'V':
cligen_output(stdout, "Clixon version %s\n", CLIXON_VERSION_STRING);
cligen_output(stdout, "Clixon version: %s\n", CLIXON_VERSION_STRING);
print_version++; /* plugins may also print versions w ca-version callback */
break;
case 'D' : { /* debug */

View file

@ -580,7 +580,7 @@ main(int argc,
help = 1;
break;
case 'V': /* version */
cligen_output(stdout, "Clixon version %s\n", CLIXON_VERSION_STRING);
cligen_output(stdout, "Clixon version: %s\n", CLIXON_VERSION_STRING);
print_version++; /* plugins may also print versions w ca-version callback */
break;
case 'D' : { /* debug */

View file

@ -709,7 +709,7 @@ main(int argc,
usage(h, argv[0]);
break;
case 'V': /* version */
cligen_output(stdout, "Clixon version %s\n", CLIXON_VERSION_STRING);
cligen_output(stdout, "Clixon version: %s\n", CLIXON_VERSION_STRING);
print_version++; /* plugins may also print versions w ca-version callback */
break;
case 'D' : { /* debug */

View file

@ -376,9 +376,9 @@ restconf_terminate(clixon_handle h)
if ((x = clicon_conf_xml(h)) != NULL)
xml_free(x);
xpath_optimize_exit();
restconf_handle_exit(h);
clixon_err_exit();
clixon_debug(CLIXON_DBG_RESTCONF, "pid:%u done", getpid());
restconf_handle_exit(h);
clixon_log_exit(); /* Must be after last clixon_debug */
return 0;
}

View file

@ -345,7 +345,7 @@ main(int argc,
usage(h, argv[0]);
break;
case 'V':
cligen_output(stdout, "Clixon version %s\n", CLIXON_VERSION_STRING);
cligen_output(stdout, "Clixon version: %s\n", CLIXON_VERSION_STRING);
print_version++; /* plugins may also print versions w ca-version callback */
break;
case 'D' : { /* debug */

View file

@ -1168,7 +1168,7 @@ main(int argc,
usage(h, argv0);
break;
case 'V': /* version */
cligen_output(stdout, "Clixon version %s\n", CLIXON_VERSION_STRING);
cligen_output(stdout, "Clixon version: %s\n", CLIXON_VERSION_STRING);
print_version++; /* plugins may also print versions w ca-version callback */
break;
case 'D' : { /* debug. Note this overrides any setting in the config */

View file

@ -381,7 +381,7 @@ main(int argc,
usage(h, argv[0]);
break;
case 'V': /* version */
cligen_output(stdout, "Clixon version %s\n", CLIXON_VERSION_STRING);
cligen_output(stdout, "Clixon version: %s\n", CLIXON_VERSION_STRING);
exit(0);
break;
case 'D' : { /* debug */

View file

@ -340,7 +340,7 @@ typedef int (errmsg_t)(clixon_handle h, const char *fn, const int line,
*
* A plugin can customize a version (or banner) output on stdout.
* Several version strings can be printed if there are multiple callbacks.
* If not regstered plugins exist, clixon prints CLIXON_VERSION_STRING
* If not registered plugins exist, clixon prints CLIXON_VERSION_STRING
* Typically invoked by command-line option -V
* @param[in] h Clixon handle
* @param[in] f Output file

View file

@ -1588,7 +1588,6 @@ xml_rm_children(cxobj *xp,
return retval;
}
/*! Remove top XML object and all children except a single child
*
* Given a root xml node, and the i:th child, remove the child from its parent

View file

@ -408,6 +408,8 @@ xml_diff1(cxobj *x0,
for (;;){
if (x0c == NULL && x1c == NULL)
goto ok;
y0c = NULL;
y1c = NULL;
/* If cl:ignore-compare extension, return equal */
if (x0c && (y0c = xml_spec(x0c)) != NULL){
if (yang_extension_value(y0c, "ignore-compare", CLIXON_LIB_NS, &extflag, NULL) < 0)

View file

@ -177,7 +177,7 @@ new "wait backend"
wait_backend
new "cli version"
expectpart "$($clixon_cli -1 -f $cfg -V)" 0 "Clixon version $CLIXON_VERSION" "Clixon main example version"
expectpart "$($clixon_cli -1 -f $cfg -V)" 0 "Clixon version: $CLIXON_VERSION" "Clixon main example version"
new "cli configure top"
expectpart "$($clixon_cli -1 -f $cfg set interfaces)" 0 "^$"