1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 07:27:59 -08:00

Convert the common imsgbuf_read calls to the post EAGAIN world.

OK tb@
This commit is contained in:
claudio 2024-11-21 13:21:33 +00:00
parent c658f39f11
commit 668e5ba9d8
71 changed files with 176 additions and 191 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.7 2024/11/21 13:17:56 claudio Exp $ */
/* $OpenBSD: control.c,v 1.8 2024/11/21 13:21:33 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -231,8 +231,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dhcp6leased.c,v 1.17 2024/11/21 13:18:37 claudio Exp $ */
/* $OpenBSD: dhcp6leased.c,v 1.18 2024/11/21 13:21:33 claudio Exp $ */
/*
* Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org>
@ -426,7 +426,7 @@ main_dispatch_frontend(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: engine.c,v 1.28 2024/11/21 13:17:56 claudio Exp $ */
/* $OpenBSD: engine.c,v 1.29 2024/11/21 13:21:33 claudio Exp $ */
/*
* Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org>
@ -276,7 +276,7 @@ engine_dispatch_frontend(int fd, short event, void *bula)
uint32_t if_index;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -385,7 +385,7 @@ engine_dispatch_main(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: frontend.c,v 1.18 2024/11/21 13:17:56 claudio Exp $ */
/* $OpenBSD: frontend.c,v 1.19 2024/11/21 13:21:33 claudio Exp $ */
/*
* Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org>
@ -243,7 +243,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
int shut = 0, udpsock, if_index;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -449,7 +449,7 @@ frontend_dispatch_engine(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.10 2024/11/21 13:17:56 claudio Exp $ */
/* $OpenBSD: control.c,v 1.11 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -233,8 +233,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dhcpleased.c,v 1.37 2024/11/21 13:18:37 claudio Exp $ */
/* $OpenBSD: dhcpleased.c,v 1.38 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@ -444,7 +444,7 @@ main_dispatch_frontend(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -526,7 +526,7 @@ main_dispatch_engine(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: engine.c,v 1.53 2024/11/21 13:17:56 claudio Exp $ */
/* $OpenBSD: engine.c,v 1.54 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@ -289,7 +289,7 @@ engine_dispatch_frontend(int fd, short event, void *bula)
uint32_t if_index, type;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -406,7 +406,7 @@ engine_dispatch_main(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: frontend.c,v 1.43 2024/11/21 13:17:56 claudio Exp $ */
/* $OpenBSD: frontend.c,v 1.44 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@ -242,7 +242,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
int shut = 0, bpfsock, if_index, udpsock;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -485,7 +485,7 @@ frontend_dispatch_engine(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.43 2024/11/21 13:17:56 claudio Exp $ */
/* $OpenBSD: control.c,v 1.44 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@ -261,8 +261,7 @@ control_dispatch_imsg(int fd, short event, void *arg)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd, cs);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: proc.c,v 1.49 2024/11/21 13:18:37 claudio Exp $ */
/* $OpenBSD: proc.c,v 1.50 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@ -617,7 +617,7 @@ proc_dispatch(int fd, short event, void *arg)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("%s: imsgbuf_read", __func__);
if (n == 0) {
/* this pipe is dead, so remove the event handler */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.15 2024/11/21 13:17:56 claudio Exp $ */
/* $OpenBSD: control.c,v 1.16 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -234,8 +234,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: engine.c,v 1.97 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: engine.c,v 1.98 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@ -465,7 +465,7 @@ engine_dispatch_frontend(int fd, short event, void *bula)
uint32_t if_index, type;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -633,7 +633,7 @@ engine_dispatch_main(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: frontend.c,v 1.72 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: frontend.c,v 1.73 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@ -286,7 +286,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
int shut = 0, icmp6sock, rdomain;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -398,7 +398,7 @@ frontend_dispatch_engine(int fd, short event, void *bula)
uint32_t if_index, type;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: slaacd.c,v 1.77 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: slaacd.c,v 1.78 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@ -391,7 +391,7 @@ main_dispatch_frontend(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -472,7 +472,7 @@ main_dispatch_engine(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.21 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: control.c,v 1.22 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -233,8 +233,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: frontend.c,v 1.87 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: frontend.c,v 1.88 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@ -311,7 +311,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
int n, shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -492,7 +492,7 @@ frontend_dispatch_resolver(int fd, short event, void *bula)
int n, shut = 0, chg;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: resolver.c,v 1.171 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: resolver.c,v 1.172 2024/11/21 13:21:34 claudio Exp $ */
/*
@ -495,7 +495,7 @@ resolver_dispatch_frontend(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -633,7 +633,7 @@ resolver_dispatch_main(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: unwind.c,v 1.73 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: unwind.c,v 1.74 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@ -398,7 +398,7 @@ main_dispatch_frontend(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -463,7 +463,7 @@ main_dispatch_resolver(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: proc.c,v 1.28 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: proc.c,v 1.29 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -77,8 +77,7 @@ proc_event_cb(__unused int fd, short events, void *arg)
struct imsg imsg;
if (!(peer->flags & PEER_BAD) && (events & EV_READ)) {
if (((n = imsgbuf_read(&peer->ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&peer->ibuf) != 1) {
peer->dispatchcb(NULL, peer->arg);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dhcp6leasectl.c,v 1.3 2024/11/21 13:17:01 claudio Exp $ */
/* $OpenBSD: dhcp6leasectl.c,v 1.4 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2021, 2024 Florian Obser <florian@openbsd.org>
@ -139,7 +139,7 @@ main(int argc, char *argv[])
if (imsgbuf_flush(ibuf) == -1)
err(1, "write error");
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dhcpleasectl.c,v 1.10 2024/11/21 13:17:01 claudio Exp $ */
/* $OpenBSD: dhcpleasectl.c,v 1.11 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2021 Florian Obser <florian@openbsd.org>
@ -173,7 +173,7 @@ main(int argc, char *argv[])
if (imsgbuf_flush(ibuf) == -1)
err(1, "write error");
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dvmrpctl.c,v 1.18 2024/11/21 13:17:01 claudio Exp $ */
/* $OpenBSD: dvmrpctl.c,v 1.19 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -177,7 +177,7 @@ main(int argc, char *argv[])
err(1, "write error");
while (!done) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.29 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: control.c,v 1.30 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -228,8 +228,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dvmrpd.c,v 1.32 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: dvmrpd.c,v 1.33 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -317,7 +317,7 @@ main_dispatch_dvmrpe(int fd, short event, void *bula)
int shut = 0, verbose;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -381,7 +381,7 @@ main_dispatch_rde(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dvmrpe.c,v 1.28 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: dvmrpe.c,v 1.29 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -241,7 +241,7 @@ dvmrpe_dispatch_main(int fd, short event, void *bula)
int shut = 0, link_ok;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -257,7 +257,7 @@ dvmrpe_dispatch_main(int fd, short event, void *bula)
for (;;) {
if ((n = imsg_get(ibuf, &imsg)) == -1)
fatal("dvmrpe_dispatch_main: imsgbuf_read error");
fatal("dvmrpe_dispatch_main: imsg_get error");
if (n == 0)
break;
@ -317,7 +317,7 @@ dvmrpe_dispatch_rde(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -333,7 +333,7 @@ dvmrpe_dispatch_rde(int fd, short event, void *bula)
for (;;) {
if ((n = imsg_get(ibuf, &imsg)) == -1)
fatal("dvmrpe_dispatch_rde: imsgbuf_read error");
fatal("dvmrpe_dispatch_rde: imsgbuf_get error");
if (n == 0)
break;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rde.c,v 1.37 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: rde.c,v 1.38 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@ -206,7 +206,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
struct iface *iface;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: eigrpctl.c,v 1.11 2024/11/21 13:17:01 claudio Exp $ */
/* $OpenBSD: eigrpctl.c,v 1.12 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@ -221,7 +221,7 @@ main(int argc, char *argv[])
err(1, "write error");
while (!done) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.14 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: control.c,v 1.15 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -220,8 +220,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: eigrpd.c,v 1.34 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: eigrpd.c,v 1.35 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@ -373,7 +373,7 @@ main_dispatch_eigrpe(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -451,7 +451,7 @@ main_dispatch_rde(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: eigrpe.c,v 1.45 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: eigrpe.c,v 1.46 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@ -226,7 +226,7 @@ eigrpe_dispatch_main(int fd, short event, void *bula)
int n, shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -398,7 +398,7 @@ eigrpe_dispatch_rde(int fd, short event, void *bula)
int n, shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rde.c,v 1.30 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: rde.c,v 1.31 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@ -175,7 +175,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -312,7 +312,7 @@ rde_dispatch_parent(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.19 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: control.c,v 1.20 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -229,8 +229,7 @@ control_dispatch_imsg(int fd, short event, void *arg)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd, cs);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: proc.c,v 1.50 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: proc.c,v 1.51 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@ -601,7 +601,7 @@ proc_dispatch(int fd, short event, void *arg)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("%s: imsgbuf_read", __func__);
if (n == 0) {
/* this pipe is dead, so remove the event handler */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ikectl.c,v 1.33 2024/11/21 13:17:02 claudio Exp $ */
/* $OpenBSD: ikectl.c,v 1.34 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2007-2013 Reyk Floeter <reyk@openbsd.org>
@ -343,7 +343,7 @@ main(int argc, char *argv[])
err(1, "write error");
while (!done) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ldapctl.c,v 1.18 2024/11/21 13:17:02 claudio Exp $ */
/* $OpenBSD: ldapctl.c,v 1.19 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@ -359,7 +359,7 @@ main(int argc, char *argv[])
err(1, "write error");
while (!done) {
if ((n = imsgbuf_read(&ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(&ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ldpctl.c,v 1.34 2024/11/21 13:17:02 claudio Exp $
/* $OpenBSD: ldpctl.c,v 1.35 2024/11/21 13:21:34 claudio Exp $
*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -210,7 +210,7 @@ main(int argc, char *argv[])
err(1, "write error");
while (!done) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.36 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: control.c,v 1.37 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -203,8 +203,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: lde.c,v 1.82 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: lde.c,v 1.83 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
@ -198,7 +198,7 @@ lde_dispatch_imsg(int fd, short event, void *bula)
int shut = 0, verbose;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -395,7 +395,7 @@ lde_dispatch_parent(int fd, short event, void *bula)
struct fec fec;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ldpd.c,v 1.75 2024/11/21 13:20:00 claudio Exp $ */
/* $OpenBSD: ldpd.c,v 1.76 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
@ -379,7 +379,7 @@ main_dispatch_ldpe(int fd, short event, void *bula)
int shut = 0, verbose;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -460,7 +460,7 @@ main_dispatch_lde(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ldpe.c,v 1.86 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: ldpe.c,v 1.87 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
@ -231,7 +231,7 @@ ldpe_dispatch_main(int fd, short event, void *bula)
int n, shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -497,7 +497,7 @@ ldpe_dispatch_lde(int fd, short event, void *bula)
struct nbr *nbr = NULL;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ospf6ctl.c,v 1.56 2024/11/21 13:17:02 claudio Exp $ */
/* $OpenBSD: ospf6ctl.c,v 1.57 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -254,7 +254,7 @@ main(int argc, char *argv[])
err(1, "write error");
while (!done) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.36 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: control.c,v 1.37 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -252,8 +252,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ospf6d.c,v 1.59 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: ospf6d.c,v 1.60 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -340,7 +340,7 @@ main_dispatch_ospfe(int fd, short event, void *bula)
int shut = 0, verbose;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -418,7 +418,7 @@ main_dispatch_rde(int fd, short event, void *bula)
int count, shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ospfe.c,v 1.76 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: ospfe.c,v 1.77 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -258,7 +258,7 @@ ospfe_dispatch_main(int fd, short event, void *bula)
int n, stub_changed, shut = 0, isvalid, wasvalid;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -451,7 +451,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula)
u_int16_t l, age;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rde.c,v 1.95 2024/11/21 13:17:57 claudio Exp $ */
/* $OpenBSD: rde.c,v 1.96 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@ -276,7 +276,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
u_int16_t l;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -652,7 +652,7 @@ rde_dispatch_parent(int fd, short event, void *bula)
int shut = 0, link_ok, prev_link_ok, orig_lsa;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ospfctl.c,v 1.70 2024/11/21 13:17:02 claudio Exp $ */
/* $OpenBSD: ospfctl.c,v 1.71 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -221,7 +221,7 @@ main(int argc, char *argv[])
output->head(res);
while (!done) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.52 2024/11/21 13:17:58 claudio Exp $ */
/* $OpenBSD: control.c,v 1.53 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -252,8 +252,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ospfd.c,v 1.122 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: ospfd.c,v 1.123 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -358,7 +358,7 @@ main_dispatch_ospfe(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -446,7 +446,7 @@ main_dispatch_rde(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ospfe.c,v 1.118 2024/11/21 13:17:58 claudio Exp $ */
/* $OpenBSD: ospfe.c,v 1.119 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -272,7 +272,7 @@ ospfe_dispatch_main(int fd, short event, void *bula)
int n, link_ok, stub_changed, shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -496,7 +496,7 @@ ospfe_dispatch_rde(int fd, short event, void *bula)
u_int16_t l, age;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rde.c,v 1.116 2024/11/21 13:17:58 claudio Exp $ */
/* $OpenBSD: rde.c,v 1.117 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@ -266,7 +266,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -651,7 +651,7 @@ rde_dispatch_parent(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ractl.c,v 1.5 2024/11/21 13:17:02 claudio Exp $ */
/* $OpenBSD: ractl.c,v 1.6 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -127,7 +127,7 @@ main(int argc, char *argv[])
err(1, "write error");
while (!done) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.12 2024/11/21 13:17:58 claudio Exp $ */
/* $OpenBSD: control.c,v 1.13 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -230,8 +230,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: engine.c,v 1.26 2024/11/21 13:17:58 claudio Exp $ */
/* $OpenBSD: engine.c,v 1.27 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@ -194,7 +194,7 @@ engine_dispatch_frontend(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -278,7 +278,7 @@ engine_dispatch_main(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: frontend.c,v 1.53 2024/11/21 13:17:58 claudio Exp $ */
/* $OpenBSD: frontend.c,v 1.54 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@ -319,7 +319,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
int n, shut = 0, icmp6sock, rdomain;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -534,7 +534,7 @@ frontend_dispatch_engine(int fd, short event, void *bula)
int n, shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rad.c,v 1.36 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: rad.c,v 1.37 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@ -381,7 +381,7 @@ main_dispatch_frontend(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;
@ -451,7 +451,7 @@ main_dispatch_engine(int fd, short event, void *bula)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* Connection closed. */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: relayctl.c,v 1.60 2024/11/21 13:17:02 claudio Exp $ */
/* $OpenBSD: relayctl.c,v 1.61 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2007 - 2013 Reyk Floeter <reyk@openbsd.org>
@ -225,7 +225,7 @@ main(int argc, char *argv[])
err(1, "write error");
while (!done) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ca.c,v 1.44 2024/11/21 13:17:02 claudio Exp $ */
/* $OpenBSD: ca.c,v 1.45 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
@ -357,7 +357,7 @@ rsae_send_imsg(int flen, const u_char *from, u_char *to, RSA *rsa,
default:
break;
}
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatalx("imsgbuf_read");
if (n == 0)
fatalx("pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.62 2024/11/21 13:17:58 claudio Exp $ */
/* $OpenBSD: control.c,v 1.63 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -231,8 +231,7 @@ control_dispatch_imsg(int fd, short event, void *arg)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd, cs);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: proc.c,v 1.50 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: proc.c,v 1.51 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@ -602,7 +602,7 @@ proc_dispatch(int fd, short event, void *arg)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("%s: imsgbuf_read", __func__);
if (n == 0) {
/* this pipe is dead, so remove the event handler */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ripctl.c,v 1.19 2024/11/21 13:17:02 claudio Exp $
/* $OpenBSD: ripctl.c,v 1.20 2024/11/21 13:21:34 claudio Exp $
*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -191,7 +191,7 @@ main(int argc, char *argv[])
err(1, "write error");
while (!done) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.32 2024/11/21 13:17:58 claudio Exp $ */
/* $OpenBSD: control.c,v 1.33 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -219,8 +219,7 @@ control_dispatch_imsg(int fd, short event, void *bula)
}
if (event & EV_READ) {
if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 &&
errno != EAGAIN) || n == 0) {
if (imsgbuf_read(&c->iev.ibuf) != 1) {
control_close(fd);
return;
}

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rde.c,v 1.29 2024/11/21 13:17:58 claudio Exp $ */
/* $OpenBSD: rde.c,v 1.30 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@ -197,7 +197,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
int shut = 0, verbose;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -300,7 +300,7 @@ rde_dispatch_parent(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ripd.c,v 1.42 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: ripd.c,v 1.43 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@ -314,7 +314,7 @@ main_dispatch_ripe(int fd, short event, void *bula)
int shut = 0, verbose;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -394,7 +394,7 @@ main_dispatch_rde(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ripe.c,v 1.35 2024/11/21 13:17:58 claudio Exp $ */
/* $OpenBSD: ripe.c,v 1.36 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@ -231,7 +231,7 @@ ripe_dispatch_main(int fd, short event, void *bula)
int link_ok, shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;
@ -312,7 +312,7 @@ ripe_dispatch_rde(int fd, short event, void *bula)
int shut = 0;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0) /* connection closed */
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: slaacctl.c,v 1.25 2024/11/21 13:17:02 claudio Exp $ */
/* $OpenBSD: slaacctl.c,v 1.26 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -140,7 +140,7 @@ main(int argc, char *argv[])
err(1, "write error");
while (!done) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: proc.c,v 1.37 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: proc.c,v 1.38 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@ -577,7 +577,7 @@ proc_dispatch(int fd, short event, void *arg)
ibuf = &iev->ibuf;
if (event & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("%s: imsgbuf_read", __func__);
if (n == 0) {
/* this pipe is dead, so remove the event handler */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: unwindctl.c,v 1.31 2024/11/21 13:17:02 claudio Exp $ */
/* $OpenBSD: unwindctl.c,v 1.32 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@ -181,7 +181,7 @@ main(int argc, char *argv[])
err(1, "write error");
while (!done) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: main.c,v 1.81 2024/11/21 13:17:02 claudio Exp $ */
/* $OpenBSD: main.c,v 1.82 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@ -277,7 +277,7 @@ vmmaction(struct parse_result *res)
err(1, "write error");
while (!done) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
errx(1, "imsgbuf_read error");
if (n == 0)
errx(1, "pipe closed");

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ldapclient.c,v 1.53 2024/11/21 13:17:02 claudio Exp $ */
/* $OpenBSD: ldapclient.c,v 1.54 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
@ -141,7 +141,7 @@ client_dispatch_dns(int fd, short events, void *p)
fatalx("unknown event");
if (events & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0)
shut = 1;
@ -241,7 +241,7 @@ client_dispatch_parent(int fd, short events, void *p)
fatalx("unknown event");
if (events & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0)
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ypldap.c,v 1.29 2024/11/21 13:18:38 claudio Exp $ */
/* $OpenBSD: ypldap.c,v 1.30 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@ -361,7 +361,7 @@ main_dispatch_client(int fd, short events, void *p)
fatalx("unknown event");
if (events & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0)
shut = 1;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ypldap_dns.c,v 1.19 2024/11/21 13:17:03 claudio Exp $ */
/* $OpenBSD: ypldap_dns.c,v 1.20 2024/11/21 13:21:34 claudio Exp $ */
/*
* Copyright (c) 2003-2008 Henning Brauer <henning@openbsd.org>
@ -146,7 +146,7 @@ dns_dispatch_imsg(int fd, short events, void *p)
fatalx("unknown event");
if (events & EV_READ) {
if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
if ((n = imsgbuf_read(ibuf)) == -1)
fatal("imsgbuf_read error");
if (n == 0)
shut = 1;