log: set syslog facility to LOG_DAEMON when run in server mode

This commit is contained in:
Daniel Eklöf 2019-11-20 19:43:31 +01:00
parent 4f4ee5b39d
commit 55a23a5b29
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 17 additions and 5 deletions

3
main.c
View file

@ -190,6 +190,8 @@ main(int argc, char *const *argv)
struct server *server = NULL;
struct shutdown_context shutdown_ctx = {.term = &term, .exit_code = EXIT_FAILURE};
log_init(as_server ? LOG_FACILITY_DAEMON : LOG_FACILITY_USER);
/* This ensures we keep a set of fonts in the cache */
if (!initialize_fonts(&conf, fonts))
goto out;
@ -241,5 +243,6 @@ out:
font_destroy(fonts[i]);
config_free(conf);
log_deinit();
return ret == EXIT_SUCCESS && !as_server ? shutdown_ctx.exit_code : ret;
}