diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-08-01 10:10:43 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-08-01 10:10:43 -0400 |
commit | 6b0355c191166576fc5b7bf3715ec457dc360a8f (patch) | |
tree | 993baadb385d2c936eb5fb9fa2491ae34cd47f8a /pullreqd.c | |
parent | 61518be4c21d6d437e6f59c0599f6df083053ff8 (diff) |
Move the `openlog()` call from `init_daemon()` to
`main()`.
Diffstat (limited to 'pullreqd.c')
-rw-r--r-- | pullreqd.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -63,9 +63,6 @@ void init_daemon(int change_dir, char *path) { /* Close any open file descriptors. */ for (int i = sysconf(_SC_OPEN_MAX); i >= 0; close(i--)); - - /* Open the logfile. */ - openlog("pullreqd", LOG_PID, LOG_DAEMON); } int init_config(char *config_file, config **cfg) { @@ -199,7 +196,12 @@ int main(int argc, char **argv) { int listen_socket = -1; int exit_status = EXIT_FAILURE; + /* Start it in daemon mode. */ init_daemon(1, "/"); + + /* Open the logfile. */ + openlog("pullreqd", LOG_PID, LOG_DAEMON); + log(LOG_NOTICE, "pullreqd started."); /* Read the config file. */ |