summaryrefslogtreecommitdiff
path: root/pullreqd.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-08-01 10:10:43 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-08-01 10:10:43 -0400
commit6b0355c191166576fc5b7bf3715ec457dc360a8f (patch)
tree993baadb385d2c936eb5fb9fa2491ae34cd47f8a /pullreqd.c
parent61518be4c21d6d437e6f59c0599f6df083053ff8 (diff)
Move the `openlog()` call from `init_daemon()` to
`main()`.
Diffstat (limited to 'pullreqd.c')
-rw-r--r--pullreqd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pullreqd.c b/pullreqd.c
index c2635a3..ae98078 100644
--- a/pullreqd.c
+++ b/pullreqd.c
@@ -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. */