summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2015-11-27 21:41:30 +0000
committerclaudio <claudio@openbsd.org>2015-11-27 21:41:30 +0000
commitf1b8840c454c9c1dddc3febc4ac9d8da0fd986ba (patch)
tree54882abca677c11d2afe1019c2ed4347bf277404
parentadd getpw to pledge. rpath would normally suffice, but there's some double (diff)
downloadwireguard-openbsd-f1b8840c454c9c1dddc3febc4ac9d8da0fd986ba.tar.xz
wireguard-openbsd-f1b8840c454c9c1dddc3febc4ac9d8da0fd986ba.zip
Imporve error messages for the imsg handler code. OK sthen@
-rw-r--r--usr.sbin/bgpd/bgpd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c
index f6e19cab83a..a6270d976f5 100644
--- a/usr.sbin/bgpd/bgpd.c
+++ b/usr.sbin/bgpd/bgpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.c,v 1.182 2015/11/20 23:26:08 florian Exp $ */
+/* $OpenBSD: bgpd.c,v 1.183 2015/11/27 21:41:30 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -903,21 +903,21 @@ handle_pollfd(struct pollfd *pfd, struct imsgbuf *i)
if (pfd->revents & POLLOUT)
if (msgbuf_write(&i->w) <= 0 && errno != EAGAIN) {
- log_warn("handle_pollfd: msgbuf_write error");
+ log_warn("imsg write error");
close(i->fd);
i->fd = -1;
return (-1);
}
if (pfd->revents & POLLIN) {
- if ((n = imsg_read(i)) == -1) {
- log_warn("handle_pollfd: imsg_read error");
+ if ((n = imsg_read(i)) == -1 && errno != EAGAIN) {
+ log_warn("imsg read error");
close(i->fd);
i->fd = -1;
return (-1);
}
- if (n == 0) { /* connection closed */
- log_warn("handle_pollfd: poll fd");
+ if (n == 0) {
+ log_warnx("peer closed imsg connection");
close(i->fd);
i->fd = -1;
return (-1);