Skip to content

Commit

Permalink
confd,statd: fix invalid option to openlog()
Browse files Browse the repository at this point in the history
LOG_DAEMON is a facility not an option.  Replace with NDELAY option and
set facility properly in call to openlog() instead.

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Aug 30, 2024
1 parent cf1c4c3 commit 7d95da7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/confd/src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ int core_post_hook(sr_session_ctx_t *session, uint32_t sub_id, const char *modul

int sr_plugin_init_cb(sr_session_ctx_t *session, void **priv)
{
int log_opts = LOG_PID | LOG_DAEMON;
int log_opts = LOG_PID | LOG_NDELAY;
int rc = SR_ERR_SYS;
char *env;
const char *env;

/* Convert into command line option+SIGUSR1 when converting to standalone confd */
env = getenv("DEBUG");
Expand All @@ -96,7 +96,7 @@ int sr_plugin_init_cb(sr_session_ctx_t *session, void **priv)
debug = 1;
}

openlog("confd", log_opts, 0);
openlog("confd", log_opts, LOG_DAEMON);

/* Save context with default running config datastore for all our models */
*priv = (void *)&confd;
Expand Down
6 changes: 3 additions & 3 deletions src/statd/statd.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,10 @@ static int sub_to_container(struct statd *statd)
int main(int argc, char *argv[])
{
struct ev_signal sigint_watcher, sigusr1_watcher;
int log_opts = LOG_PID | LOG_DAEMON;
int log_opts = LOG_PID | LOG_NDELAY;
struct statd statd = {};
sr_conn_ctx_t *sr_conn;
char *env;
const char *env;
int err;

env = getenv("DEBUG");
Expand All @@ -547,7 +547,7 @@ int main(int argc, char *argv[])
debug = 1;
}

openlog("statd", log_opts, 0);
openlog("statd", log_opts, LOG_DAEMON);

TAILQ_INIT(&statd.subs);
statd.ev_loop = EV_DEFAULT;
Expand Down

0 comments on commit 7d95da7

Please sign in to comment.