aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-06-11 09:18:30 +0000
committerOmar Polo <op@omarpolo.com>2023-06-11 09:18:30 +0000
commit15e60fdf0c1dadf79b319635c4b6fe6786f1d3d4 (patch)
tree2e4d49630604eb4f4227e546aaae99210c10ab3a /config.c
parent2e880a57f8bd6f9e8b10f9fbdb9feea35523226d (diff)
simplify ocsp sending using config_send_file
while here add an explicit flush to avoid a fd rampage.
Diffstat (limited to 'config.c')
-rw-r--r--config.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/config.c b/config.c
index ba7cbc0..d89ebf8 100644
--- a/config.c
+++ b/config.c
@@ -323,11 +323,10 @@ config_send(struct conf *conf)
return -1;
if (h->ocsp_path != NULL) {
- log_debug("sending ocsp %s", h->ocsp_path);
- if ((fd = open(h->ocsp_path, O_RDONLY)) == -1)
- fatal("can't open %s", h->ocsp_path);
- if (config_send_file(ps, PROC_SERVER, IMSG_RECONF_OCSP,
- fd, NULL, 0) == -1)
+ if (config_open_send(ps, PROC_SERVER, IMSG_RECONF_OCSP,
+ h->ocsp_path) == -1)
+ return -1;
+ if (proc_flush_imsg(ps, PROC_SERVER, -1) == -1)
return -1;
}