xpath multiple match, int main, etc

This commit is contained in:
Olof Hagsand 2016-11-17 21:25:49 +01:00
parent 303f4a35a8
commit 5c938febf4
6 changed files with 36 additions and 23 deletions

View file

@ -109,7 +109,7 @@ install-include: clixon_backend.h clixon_backend_handle.h clixon_backend_transac
# Just link test programs
test.c :
echo "main(){}" > $@
echo "int main(){}" > $@
test: test.c $(LIBOBJ)
$(CC) $(INCLUDES) $(LDFLAGS) $< $(LIBOBJ) -L. -l:$(MYLIB) $(LIBS) -o $@

View file

@ -302,7 +302,8 @@ main(int argc, char **argv)
int sockfamily;
/* In the startup, logs to stderr & syslog and debug flag set later */
clicon_log_init(__PROGRAM__, LOG_INFO, CLICON_LOG_STDERR|CLICON_LOG_SYSLOG);
clicon_log_init(__PROGRAM__, LOG_INFO, CLICON_LOG_STDERR|CLICON_LOG_SYSLOG);
/* Initiate CLICON handle */
if ((h = backend_handle_init()) == NULL)
return -1;
@ -343,10 +344,13 @@ main(int argc, char **argv)
break;
}
/*
* Here we have the debug flag settings, use that.
* Syslogs also to stderr, but later turn stderr off in daemon mode.
* error only to syslog. debug to syslog
* XXX: if started in a start-daemon script, there will be irritating
* double syslogs until fork below.
*/
clicon_log_init(__PROGRAM__, debug?LOG_DEBUG:LOG_INFO, CLICON_LOG_STDERR|CLICON_LOG_SYSLOG);
clicon_log_init(__PROGRAM__, debug?LOG_DEBUG:LOG_INFO, CLICON_LOG_SYSLOG);
clicon_debug_init(debug, NULL);
/* Find and read configfile */
@ -554,7 +558,7 @@ main(int argc, char **argv)
demonized errors OK. Before this stage, errors are logged on stderr
also */
if (foreground==0){
clicon_log_init(__PROGRAM__, debug?LOG_DEBUG:LOG_INFO, CLICON_LOG_SYSLOG);
clicon_log_init(__PROGRAM__, debug?LOG_DEBUG:LOG_INFO, CLICON_LOG_SYSLOG);
if (daemon(0, 0) < 0){
fprintf(stderr, "config: daemon");
exit(-1);

View file

@ -105,7 +105,7 @@ uninstall:
# Just link test programs
test.c :
echo "main(){}" > $@
echo "int main(){}" > $@
test: test.c $(LIBOBJ)
$(CC) $(INCLUDES) $(LDFLAGS) $< $(LIBOBJ) -L. -l:$(MYLIB) $(LIBS) -o $@

View file

@ -138,6 +138,8 @@ str2cvec(char *string,
clicon_debug(1, "error cvec_add %s", strerror(errno));
goto err;
}
while ((strlen(s) > 0) && isblank(*s))
s++;
cv_name_set(cv, s);
cv_string_set(cv, valu);
free(valu);

View file

@ -432,7 +432,8 @@ request_process(clicon_handle h,
/* If present, check credentials */
if (plugin_credentials(h, r, &auth) < 0)
goto done;
clicon_debug(1, "%s credentials ok 1", __FUNCTION__);
clicon_debug(1, "%s credentials ok auth:%d (should be 1)",
__FUNCTION__, auth);
if (auth == 0)
goto done;
clicon_debug(1, "%s credentials ok 2", __FUNCTION__);