Fixes for 4.4 release

This commit is contained in:
Olof hagsand 2020-03-24 16:41:30 +01:00
parent 09a2e09848
commit a7e0a30938
7 changed files with 22 additions and 11 deletions

View file

@ -77,8 +77,8 @@ struct err_state{
/*
* Variables
*/
int clicon_errno = 0; /* See enum clicon_err */
int clicon_suberrno = 0; /* Corresponds to errno.h */
int clicon_errno = 0; /* See enum clicon_err XXX: hide this and change to err_category */
int clicon_suberrno = 0; /* Corresponds to errno.h XXX: change to errno */
char clicon_err_reason[ERR_STRLEN] = {0, };
/*
@ -147,7 +147,7 @@ clicon_err_reset(void)
int clicon_err_fn(const char *fn,
const int line,
int category,
int err,
int suberr,
char *format, ...)
{
va_list args;
@ -157,7 +157,7 @@ int clicon_err_fn(const char *fn,
/* Set the global variables */
clicon_errno = category;
clicon_suberrno = errno;
clicon_suberrno = suberr;
/* first round: compute length of error message */
va_start(args, format);

View file

@ -3,7 +3,8 @@
***** BEGIN LICENSE BLOCK *****
Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren
Copyright (C) 2017-2020 Olof Hagsand
Copyright (C) 2017-2019 Olof Hagsand
Copyright (C) 2020 Olof Hagsand and Rubicon Communications, LLC
This file is part of CLIXON.
@ -48,6 +49,7 @@
#include <string.h>
#include <limits.h>
#include <stdint.h>
#include <syslog.h>
/* cligen */
#include <cligen/cligen.h>
@ -1535,8 +1537,11 @@ clixon_netconf_error_fn(const char *fn,
}
if (netconf_err2cb(xerr, cb) < 0)
goto done;
clicon_err_fn(fn, line, category, 0, "%s", cbuf_get(cb));
#if 0 /* More verbose output for debugging */
clicon_log(LOG_ERR, "%s: %d: %s", fn, line, cbuf_get(cb));
#else
clicon_log(LOG_ERR, "%s", cbuf_get(cb));
#endif
retval = 0;
done:
if (cb)

View file

@ -245,6 +245,7 @@ parse_configfile(clicon_handle h,
}
if (netconf_err2cb(xerr, cbret) < 0)
goto done;
/* Here one could make it more relaxing to not quit on unrecognized option? */
clixon_netconf_error(OE_CFG, xerr, NULL, NULL);
goto done;
}