Use clicon_err() consistently and drop perror()

This commit is contained in:
Philip Prindeville 2023-08-23 13:48:04 -06:00 committed by Olof Hagsand
parent 9d9528d503
commit 959e060995
5 changed files with 65 additions and 59 deletions

View file

@ -1029,13 +1029,13 @@ main(int argc,
daemonized errors OK. Before this stage, errors are logged on stderr
also */
if (foreground==0){
clicon_log_init(__PROGRAM__, dbg?LOG_DEBUG:LOG_INFO,
logdst==CLICON_LOG_FILE?CLICON_LOG_FILE:CLICON_LOG_SYSLOG);
/* Call plugin callbacks just before fork/daemonization */
if (clixon_plugin_pre_daemon_all(h) < 0)
goto done;
clicon_log_init(__PROGRAM__, dbg?LOG_DEBUG:LOG_INFO,
logdst==CLICON_LOG_FILE?CLICON_LOG_FILE:CLICON_LOG_SYSLOG);
if (daemon(0, 0) < 0){
fprintf(stderr, "config: daemon");
clicon_err(OE_UNIX, errno, "daemon");
exit(-1);
}
}

View file

@ -669,7 +669,7 @@ restconf_clixon_backend(clicon_handle h,
while (1){
if (clicon_hello_req(h, "cl:restconf", NULL, &id) < 0){
if (errno == ENOENT){
fprintf(stderr, "waiting");
clicon_err(OE_UNIX, errno, "waiting");
sleep(1);
continue;
}