summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/fastd.c b/src/fastd.c
index c75fa9b..3cc7d37 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -133,6 +133,8 @@ static void init_log(fastd_context_t *ctx) {
ctx->log_files = file;
}
+ ctx->log_initialized = true;
+
if (seteuid(uid) < 0)
pr_debug_errno(ctx, "seteuid");
if (setegid(gid) < 0)
@@ -757,15 +759,11 @@ int main(int argc, char *argv[]) {
fastd_config_t conf;
fastd_configure(&ctx, &conf, argc, argv);
- init_log(&ctx);
-
if (conf.generate_key) {
conf.protocol->generate_key(&ctx);
exit(0);
}
- init_signals(&ctx);
-
conf.protocol_config = conf.protocol->init(&ctx);
if (conf.show_key) {
@@ -773,6 +771,9 @@ int main(int argc, char *argv[]) {
exit(0);
}
+ init_log(&ctx);
+ init_signals(&ctx);
+
update_time(&ctx);
conf.long_ago = ctx.now;