From: claudio Date: Thu, 14 Dec 2023 09:58:37 +0000 (+0000) Subject: Use imsg_get_fd() to access the fd passed with the imsg. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=dcedc8ac33cc46ff4f5ddf1c88986b52dd0671f8;p=openbsd Use imsg_get_fd() to access the fd passed with the imsg. Go ahead florian@ OK tb@ --- diff --git a/sbin/dhcpleased/engine.c b/sbin/dhcpleased/engine.c index d435850af1d..cc6610f2d47 100644 --- a/sbin/dhcpleased/engine.c +++ b/sbin/dhcpleased/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.40 2023/11/25 12:00:39 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.41 2023/12/14 09:58:37 claudio Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser @@ -430,7 +430,7 @@ engine_dispatch_main(int fd, short event, void *bula) fatalx("%s: received unexpected imsg fd " "to engine", __func__); - if ((fd = imsg.fd) == -1) + if ((fd = imsg_get_fd(&imsg)) == -1) fatalx("%s: expected to receive imsg fd to " "engine but didn't receive any", __func__); diff --git a/sbin/dhcpleased/frontend.c b/sbin/dhcpleased/frontend.c index 3640f3bdbbc..74335b88e63 100644 --- a/sbin/dhcpleased/frontend.c +++ b/sbin/dhcpleased/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.31 2023/11/25 12:00:39 florian Exp $ */ +/* $OpenBSD: frontend.c,v 1.32 2023/12/14 09:58:37 claudio Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser @@ -269,7 +269,7 @@ frontend_dispatch_main(int fd, short event, void *bula) fatalx("%s: received unexpected imsg fd " "to frontend", __func__); - if ((fd = imsg.fd) == -1) + if ((fd = imsg_get_fd(&imsg)) == -1) fatalx("%s: expected to receive imsg fd to " "frontend but didn't receive any", __func__); @@ -287,7 +287,7 @@ frontend_dispatch_main(int fd, short event, void *bula) event_add(&iev_engine->ev, NULL); break; case IMSG_BPFSOCK: - if ((bpfsock = imsg.fd) == -1) + if ((bpfsock = imsg_get_fd(&imsg)) == -1) fatalx("%s: expected to receive imsg " "bpf fd but didn't receive any", __func__); @@ -298,7 +298,7 @@ frontend_dispatch_main(int fd, short event, void *bula) set_bpfsock(bpfsock, if_index); break; case IMSG_UDPSOCK: - if ((udpsock = imsg.fd) == -1) + if ((udpsock = imsg_get_fd(&imsg)) == -1) fatalx("%s: expected to receive imsg " "udpsocket fd but didn't receive any", __func__); @@ -327,7 +327,7 @@ frontend_dispatch_main(int fd, short event, void *bula) } break; case IMSG_ROUTESOCK: - if ((fd = imsg.fd) == -1) + if ((fd = imsg_get_fd(&imsg)) == -1) fatalx("%s: expected to receive imsg " "routesocket fd but didn't receive any", __func__); @@ -430,7 +430,7 @@ frontend_dispatch_main(int fd, short event, void *bula) break; } case IMSG_CONTROLFD: - if ((fd = imsg.fd) == -1) + if ((fd = imsg_get_fd(&imsg)) == -1) fatalx("%s: expected to receive imsg " "control fd but didn't receive any", __func__);