summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsunil <sunil@openbsd.org>2016-02-09 11:50:49 +0000
committersunil <sunil@openbsd.org>2016-02-09 11:50:49 +0000
commit8115d36956a939c1a7db298f21e5c0ed9a086cfe (patch)
treec9adcbc9803bada7507cb4d867fca72e0325e885
parentrename variable sun to s_un to ease portability (diff)
downloadwireguard-openbsd-8115d36956a939c1a7db298f21e5c0ed9a086cfe.tar.xz
wireguard-openbsd-8115d36956a939c1a7db298f21e5c0ed9a086cfe.zip
r1.16 accidentally masked retries on EAGAIN introduced in r1.15.
Fix and simplify imsg_read() return value checking into a single if..else block. Ok gilles@ jung@
-rw-r--r--usr.sbin/smtpd/mproc.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/smtpd/mproc.c b/usr.sbin/smtpd/mproc.c
index b86817ffd3a..984e7f107b9 100644
--- a/usr.sbin/smtpd/mproc.c
+++ b/usr.sbin/smtpd/mproc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mproc.c,v 1.16 2015/12/05 13:14:21 claudio Exp $ */
+/* $OpenBSD: mproc.c,v 1.17 2016/02/09 11:50:49 sunil Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@faurot.net>
@@ -157,14 +157,13 @@ mproc_dispatch(int fd, short event, void *arg)
else
n = imsg_read(&p->imsgbuf);
- if (n == -1 && errno != EAGAIN) {
+ if (n == -1 && errno == EAGAIN)
+ return;
+ else if (n == -1) {
log_warn("warn: %s -> %s: imsg_read",
proc_name(smtpd_process), p->name);
- if (errno == EAGAIN)
- return;
fatal("exiting");
- }
- if (n == 0) {
+ } else if (n == 0) {
/* this pipe is dead, so remove the event handler */
if (smtpd_process != PROC_CONTROL ||
p->proc != PROC_CLIENT)
@@ -172,7 +171,7 @@ mproc_dispatch(int fd, short event, void *arg)
proc_name(smtpd_process), p->name);
p->handler(p, NULL);
return;
- } else if (n != -1)
+ } else
p->bytes_in += n;
}