aboutsummaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-06-08 15:57:11 +0000
committerOmar Polo <op@omarpolo.com>2023-06-08 15:57:11 +0000
commite69e1151f696b01d1fe80570901d21bc78ed5ab1 (patch)
tree8fe1bea21917b3015e7d34f397654f64d2f71171 /utils.c
parent2b4ef796d78a9d76952115852e3aef56f00b7beb (diff)
drop now unused dispatch_imsg
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/utils.c b/utils.c
index 8b54dae..ff69a35 100644
--- a/utils.c
+++ b/utils.c
@@ -241,33 +241,3 @@ end:
X509_STORE_CTX_free(ctx);
return ret;
}
-
-void
-dispatch_imsg(struct imsgbuf *ibuf, imsg_handlerfn **handlers, size_t size)
-{
- struct imsg imsg;
- size_t datalen, i;
- ssize_t n;
-
- if ((n = imsg_read(ibuf)) == -1) {
- if (errno == EAGAIN || errno == EWOULDBLOCK)
- return;
- _exit(1);
- }
-
- if (n == 0)
- _exit(1);
-
- for (;;) {
- if ((n = imsg_get(ibuf, &imsg)) == -1)
- _exit(1);
- if (n == 0)
- return;
- datalen = imsg.hdr.len - IMSG_HEADER_SIZE;
- i = imsg.hdr.type;
- if (i > (size / sizeof(imsg_handlerfn*)) || handlers[i] == NULL)
- abort();
- handlers[i](ibuf, &imsg, datalen);
- imsg_free(&imsg);
- }
-}