From d9be77f0a155626b7db248b988d52bcd21eedee9 Mon Sep 17 00:00:00 2001 From: claudio Date: Thu, 14 Dec 2023 11:09:34 +0000 Subject: [PATCH] Use imsg_get_fd() to access the file descriptor passed in the imsg. OK tb@ --- usr.sbin/rad/engine.c | 4 ++-- usr.sbin/rad/frontend.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/rad/engine.c b/usr.sbin/rad/engine.c index ceb11d574e3..1205509d6ec 100644 --- a/usr.sbin/rad/engine.c +++ b/usr.sbin/rad/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.21 2022/10/15 13:26:15 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.22 2023/12/14 11:09:34 claudio Exp $ */ /* * Copyright (c) 2018 Florian Obser @@ -304,7 +304,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/usr.sbin/rad/frontend.c b/usr.sbin/rad/frontend.c index 66ebf0c8ff5..daeb49d05de 100644 --- a/usr.sbin/rad/frontend.c +++ b/usr.sbin/rad/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.42 2022/12/28 21:30:18 jmc Exp $ */ +/* $OpenBSD: frontend.c,v 1.43 2023/12/14 11:09:34 claudio Exp $ */ /* * Copyright (c) 2018 Florian Obser @@ -339,7 +339,7 @@ frontend_dispatch_main(int fd, short event, void *bula) if (iev_engine) 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__); @@ -465,7 +465,7 @@ frontend_dispatch_main(int fd, short event, void *bula) nconf = NULL; break; case IMSG_ICMP6SOCK: - if ((icmp6sock = imsg.fd) == -1) + if ((icmp6sock = imsg_get_fd(&imsg)) == -1) fatalx("%s: expected to receive imsg " "ICMPv6 fd but didn't receive any", __func__); @@ -479,7 +479,7 @@ frontend_dispatch_main(int fd, short event, void *bula) if (routesock != -1) fatalx("%s: received unexpected routesock fd", __func__); - if ((routesock = imsg.fd) == -1) + if ((routesock = imsg_get_fd(&imsg)) == -1) fatalx("%s: expected to receive imsg " "routesocket fd but didn't receive any", __func__); @@ -490,7 +490,7 @@ frontend_dispatch_main(int fd, short event, void *bula) frontend_startup(); 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__); -- 2.20.1