diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2ee40c5a..534d349d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,7 +87,7 @@ Notes: ### Comments -Use `/* */`. Use `//` only for temporal comments. +Use `/* */`. Use `//` only for temporary comments. Do not use "======", ">>>>>" or "<<<<<<" in comments since git merge conflict uses that. diff --git a/apps/cli/cli_main.c b/apps/cli/cli_main.c index e8c03c9e..e168356e 100644 --- a/apps/cli/cli_main.c +++ b/apps/cli/cli_main.c @@ -74,6 +74,7 @@ /* Command line options to be passed to getopt(3) */ #define CLI_OPTS "+hVD:f:E:l:C:F:1a:u:d:m:qp:GLy:c:U:o:" + /*! Check if there is a CLI history file and if so dump the CLI histiry to it * * Just log if file does not exist or is not readable diff --git a/apps/cli/cli_plugin.c b/apps/cli/cli_plugin.c index eec5e28a..316045bc 100644 --- a/apps/cli/cli_plugin.c +++ b/apps/cli/cli_plugin.c @@ -748,7 +748,6 @@ clicon_cliread(clixon_handle h, goto done; goto fail; } - retval = 1; done: if (pfmt) diff --git a/apps/restconf/restconf_native.c b/apps/restconf/restconf_native.c index c07e9449..89ca5d2c 100644 --- a/apps/restconf/restconf_native.c +++ b/apps/restconf/restconf_native.c @@ -323,10 +323,12 @@ restconf_connection_sanity(clixon_handle h, char *media_str = NULL; char *oneline = NULL; + clixon_debug(CLIXON_DBG_RESTCONF, ""); /* 1) Check if http/2 non-tls is disabled */ if (rc->rc_ssl == NULL && rc->rc_proto == HTTP_2 && clicon_option_bool(h, "CLICON_RESTCONF_HTTP2_PLAIN") == 0){ + clixon_debug(CLIXON_DBG_RESTCONF, "Sanity check http/2 non-tls failed, disconnect"); if (netconf_invalid_value_xml(&xerr, "protocol", "Only HTTP/2 with TLS is enabled, plain http/2 is disabled") < 0) goto done; if ((media_str = restconf_param_get(h, "HTTP_ACCEPT")) == NULL){ @@ -343,6 +345,7 @@ restconf_connection_sanity(clixon_handle h, /* 2) Check if ssl client cert is valid */ else if (rc->rc_ssl != NULL && (code = SSL_get_verify_result(rc->rc_ssl)) != 0){ + clixon_debug(CLIXON_DBG_RESTCONF, "Sanity check cert error SSL_get_verify_result: %ld, disconnect", code); /* Syslog cert failure */ if (ssl_x509_name_oneline(rc->rc_ssl, &oneline) < 0) goto done; @@ -372,6 +375,7 @@ restconf_connection_sanity(clixon_handle h, } retval = 0; done: + clixon_debug(CLIXON_DBG_RESTCONF, "retval:%d", retval); if (oneline) free(oneline); if (cberr) diff --git a/lib/src/clixon_datastore_read.c b/lib/src/clixon_datastore_read.c index 7bc3b783..5a8cea0f 100644 --- a/lib/src/clixon_datastore_read.c +++ b/lib/src/clixon_datastore_read.c @@ -492,7 +492,7 @@ xmldb_multi_read_applyfn(cxobj *x, dbfile = cbuf_get(cb); clixon_debug(CLIXON_DBG_DATASTORE, "Parsing: %s", dbfile); if ((fp = fopen(dbfile, "r")) == NULL){ - clixon_err(OE_CFG, errno, "fdopen(%s)", dbfile); + clixon_err(OE_CFG, errno, "fopen(%s)", dbfile); goto done; } switch (mr->mr_format){ diff --git a/lib/src/clixon_xml_map.c b/lib/src/clixon_xml_map.c index f651c2e9..fb345315 100644 --- a/lib/src/clixon_xml_map.c +++ b/lib/src/clixon_xml_map.c @@ -2245,8 +2245,10 @@ clixon_compare_xmls(cxobj *xc1, clixon_err(OE_UNDEF, errno, "tmpfile"); goto done; } - if ((f = fdopen(fd, "w")) == NULL) + if ((f = fdopen(fd, "w")) == NULL){ + clixon_err(OE_XML, errno, "fdopen(%s)", filename1); goto done; + } switch(format){ case FORMAT_TEXT: if (clixon_text2file(f, xc1, 0, cligen_output, 1, 1) < 0) @@ -2260,14 +2262,14 @@ clixon_compare_xmls(cxobj *xc1, } fclose(f); close(fd); - if ((fd = mkstemp(filename2)) < 0){ clixon_err(OE_UNDEF, errno, "mkstemp: %s", strerror(errno)); goto done; } - if ((f = fdopen(fd, "w")) == NULL) + if ((f = fdopen(fd, "w")) == NULL){ + clixon_err(OE_XML, errno, "fdopen(%s)", filename2); goto done; - + } switch(format){ case FORMAT_TEXT: if (clixon_text2file(f, xc2, 0, cligen_output, 1, 1) < 0) diff --git a/lib/src/clixon_xpath.c b/lib/src/clixon_xpath.c index e34e9b04..4d235dcd 100644 --- a/lib/src/clixon_xpath.c +++ b/lib/src/clixon_xpath.c @@ -1178,7 +1178,7 @@ xpath2canonical(const char *xpath0, * @param[in] xcur xml-tree where to search * @param[in] nsc External XML namespace context, or NULL * @param[in] xpath XPath syntax - * @param[oit] count Nr of elements of xpath + * @param[out] count Nr of elements of xpath * @retval 0 OK * @retval -1 Error * @note This function is made for making optimizations in certain circumstances, such as a list