commit 5728bd4f29e4bd6eafe8898abea7758b4e84015b from: claudio date: Thu Nov 21 13:21:33 2024 UTC Convert the common imsgbuf_read calls to the post EAGAIN world. OK tb@ commit - 9d8a74db131fbfce7fbfec4a594b78a3ceac6d13 commit + 5728bd4f29e4bd6eafe8898abea7758b4e84015b blob - 55976ae5618a673e9341a9673f3d5b30c7d900d9 blob + f5d8143a24bb7dc251d1114a90fcdc7f5f43eb7c --- control.c +++ control.c @@ -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 @@ -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; } blob - ca7fb6ff8f4bd787f095aba3583d30cf56dcdb39 blob + 972946f82a498cd750eafc1ebf53f368d0f96f91 --- proc.c +++ proc.c @@ -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 @@ -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 */