Formatting and debugs

This commit is contained in:
Olof hagsand 2024-05-28 18:50:07 +02:00
parent c377a28d56
commit e2140aed10
7 changed files with 14 additions and 8 deletions

View file

@ -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){

View file

@ -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)

View file

@ -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