- Changed master to 5.2.0.PRE

- Modified Makefiles for static linkage and coverage
- test namespace abstractions
This commit is contained in:
Olof hagsand 2021-04-17 14:52:42 +02:00
parent f9f533834b
commit 7ebb538ebf
18 changed files with 112 additions and 109 deletions

View file

@ -53,10 +53,9 @@ CLIXON_MINOR = @CLIXON_VERSION_MINOR@
VPATH = @srcdir@
CC = @CC@
LINKAGE = @LINKAGE@
ifeq ($(LINKAGE),static)
CFLAGS = @CFLAGS@
else
CFLAGS = -fPIC @CFLAGS@
CFLAGS = @CFLAGS@
ifeq ($(LINKAGE),dynamic)
CFLAGS += -fPIC
endif
SH_SUFFIX = @SH_SUFFIX@
INSTALL = @INSTALL@

View file

@ -209,7 +209,7 @@ plugin_load_one(clicon_handle h,
dlerror(); /* Clear any existing error */
if ((handle = dlopen(file, dlflags)) == NULL) {
error = (char*)dlerror();
clicon_err(OE_PLUGIN, errno, "dlopen: %s", error ? error : "Unknown error");
clicon_err(OE_PLUGIN, errno, "dlopen(%s): %s", file, error ? error : "Unknown error");
goto done;
}
/* call plugin_init() if defined, eg CLIXON_PLUGIN_INIT or CLIXON_BACKEND_INIT */
@ -692,6 +692,24 @@ typedef struct {
/* List of rpc callback entries XXX hang on handle */
static rpc_callback_t *rpc_cb_list = NULL;
#if 0 /* Debugging */
static int
rpc_callback_dump(clicon_handle h,
FILE *f)
{
rpc_callback_t *rc;
if ((rc = rpc_cb_list) != NULL)
do {
fprintf(f, "%s %s\n", __FUNCTION__, rc->rc_name);
rc = NEXTQ(rpc_callback_t *, rc);
} while (rc != rpc_cb_list);
fprintf(f, "%s--------------\n", __FUNCTION__);
return 0;
}
#endif
/*! Register a RPC callback by appending a new RPC to the list
*
* @param[in] h clicon handle

View file

@ -398,68 +398,6 @@ clixon_process_argv_get(clicon_handle h,
return 0;
}
#ifdef NYI
/*! Make a copy of process-entry struct
*
* @param[in] pe0 Original process-entry
* @param[in] pnew New copy of pe0
*/
static int
clixon_process_register_dup(process_entry_t *pe0,
process_entry_t **pnew)
{
int retval = -1;
process_entry_t *pe1 = NULL;
int i;
if (pe0 == NULL){
clicon_err(OE_DB, EINVAL, "pe0 is NULL");
goto done;
}
if (pnew == NULL){
clicon_err(OE_DB, EINVAL, "pnew is NULL");
goto done;
}
if ((pe1 = malloc(sizeof(process_entry_t))) == NULL) {
clicon_err(OE_DB, errno, "malloc");
goto done;
}
memset(pe1, 0, sizeof(*pe1));
memcpy(pe1, pe0, sizeof(process_entry_t)); /* Note lots of malloced memory that needs to be handled after this copy*/
pe1->pe_exiting = 0;
pe1->pe_clone = 0;
if ((pe1->pe_name = strdup(pe0->pe_name)) == NULL){
clicon_err(OE_DB, errno, "strdup name");
goto done;
}
if (pe0->pe_description && (pe1->pe_description = strdup(pe0->pe_description)) == NULL){
clicon_err(OE_DB, errno, "strdup name");
goto done;
}
if (pe0->pe_netns && (pe1->pe_netns = strdup(pe0->pe_netns)) == NULL){
clicon_err(OE_DB, errno, "strdup netns");
goto done;
}
if ((pe1->pe_argv = calloc(pe0->pe_argc, sizeof(char *))) == NULL){
clicon_err(OE_UNIX, errno, "calloc");
goto done;
}
for (i=0; i<pe0->pe_argc; i++){
if (pe0->pe_argv[i] != NULL &&
(pe1->pe_argv[i] = strdup(pe0->pe_argv[i])) == NULL){
clicon_err(OE_UNIX, errno, "strdup");
goto done;
}
}
ADDQ(pe1, _proc_entry_list);
*pnew = pe1;
retval = 0;
done:
/* dealloc pe1 on error */
return retval;
}
#endif
/*! Register an internal process
*
* @param[in] h Clixon handle