commit - d8c5a49979cbd72335d978f164c33aae604754d6
commit + 5400b2df83f1447d73ff30ed10d04cf1d2a78b1e
blob - 51f4552080c86a3a3c66e26213112cfe6c0ca58b
blob + 70889e25ecfc220858913785552e9a1c82bae160
--- gotd/gotd.c
+++ gotd/gotd.c
}
static void
+reload_reset(void)
+{
+ /* Clear state such that reloading again will work. */
+ close(gotd_reload_conf_fd);
+ gotd_reload_conf_fd = -1;
+ close(gotd_reload_secrets_fd);
+ gotd_reload_secrets_fd = -1;
+ have_reload_secrets = 0;
+}
+
+static void
gotd_dispatch_reload(int fd, short event, void *arg)
{
const struct got_error *err = NULL;
kill_proc(gotd.reload_proc, 0);
gotd.reload_proc = NULL;
imsg_free(&imsg);
+ reload_reset();
return;
}
imsgbuf_clear(&ibuf);
close(GOTD_FILENO_MSG_PIPE);
- /* Clear state such that reloading again will work. */
- close(gotd_reload_conf_fd);
- gotd_reload_conf_fd = -1;
- close(gotd_reload_secrets_fd);
- gotd_reload_secrets_fd = -1;
- have_reload_secrets = 0;
+ reload_reset();
}
gotd.argv0 = argv0;