Skip to content

Commit 7d95da7

Browse files
committed
confd,statd: fix invalid option to openlog()
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]>
1 parent cf1c4c3 commit 7d95da7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/confd/src/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ int core_post_hook(sr_session_ctx_t *session, uint32_t sub_id, const char *modul
8585

8686
int sr_plugin_init_cb(sr_session_ctx_t *session, void **priv)
8787
{
88-
int log_opts = LOG_PID | LOG_DAEMON;
88+
int log_opts = LOG_PID | LOG_NDELAY;
8989
int rc = SR_ERR_SYS;
90-
char *env;
90+
const char *env;
9191

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

99-
openlog("confd", log_opts, 0);
99+
openlog("confd", log_opts, LOG_DAEMON);
100100

101101
/* Save context with default running config datastore for all our models */
102102
*priv = (void *)&confd;

src/statd/statd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,10 @@ static int sub_to_container(struct statd *statd)
535535
int main(int argc, char *argv[])
536536
{
537537
struct ev_signal sigint_watcher, sigusr1_watcher;
538-
int log_opts = LOG_PID | LOG_DAEMON;
538+
int log_opts = LOG_PID | LOG_NDELAY;
539539
struct statd statd = {};
540540
sr_conn_ctx_t *sr_conn;
541-
char *env;
541+
const char *env;
542542
int err;
543543

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

550-
openlog("statd", log_opts, 0);
550+
openlog("statd", log_opts, LOG_DAEMON);
551551

552552
TAILQ_INIT(&statd.subs);
553553
statd.ev_loop = EV_DEFAULT;

0 commit comments

Comments
 (0)