aboutsummaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2024-01-21 12:23:28 +0000
committerOmar Polo <op@omarpolo.com>2024-01-21 12:23:28 +0000
commit6dec2ad700aac233ab001f91b8fa05813180eaba (patch)
treeade12becb86ae1edd4c83a13d6382ea54e3470d3 /proc.c
parentb03e976aa26d100ec1bf976dfdd005868395b490 (diff)
convert most of gmid to the new imsg APIs
Makes parsing and handling of imsgs simpler / clearer. only crypto.c is left as-is.
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/proc.c b/proc.c
index 50cabc7..7e160a8 100644
--- a/proc.c
+++ b/proc.c
@@ -671,8 +671,8 @@ proc_dispatch(int fd, short event, void *arg)
*/
switch (imsg.hdr.type) {
case IMSG_CTL_PROCFD:
- IMSG_SIZE_CHECK(&imsg, &pf);
- memcpy(&pf, imsg.data, sizeof(pf));
+ if (imsg_get_data(&imsg, &pf, sizeof(pf)))
+ fatalx("bad length imsg CTL_PROCFD");
proc_accept(ps, imsg_get_fd(&imsg), pf.pf_procid,
pf.pf_instance);
break;