From 2b721f231f4c9963f5fc1edb23211ebb0094c642 Mon Sep 17 00:00:00 2001 From: reyk Date: Sat, 12 Jul 2014 14:15:04 +0000 Subject: [PATCH] Sync msgbuf_write() changes from relayd. Please note that proc.c should be kept identical in relayd, iked and snmpd (currently without the includes). ok benno@ --- sbin/iked/proc.c | 4 ++-- usr.sbin/snmpd/control.c | 4 ++-- usr.sbin/snmpd/proc.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/iked/proc.c b/sbin/iked/proc.c index 37a9d149c75..5fc1b6fdac9 100644 --- a/sbin/iked/proc.c +++ b/sbin/iked/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.17 2014/05/08 13:11:16 blambert Exp $ */ +/* $OpenBSD: proc.c,v 1.18 2014/07/12 14:15:04 reyk Exp $ */ /* * Copyright (c) 2010 - 2014 Reyk Floeter @@ -464,7 +464,7 @@ proc_dispatch(int fd, short event, void *arg) } if (event & EV_WRITE) { - if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN) + if (msgbuf_write(&ibuf->w) <= 0 && errno != EAGAIN) fatal(title); } diff --git a/usr.sbin/snmpd/control.c b/usr.sbin/snmpd/control.c index 8e613a2ba25..686ca47c7a6 100644 --- a/usr.sbin/snmpd/control.c +++ b/usr.sbin/snmpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.25 2014/06/03 06:25:47 yasuoka Exp $ */ +/* $OpenBSD: control.c,v 1.26 2014/07/12 14:15:04 reyk Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter @@ -238,7 +238,7 @@ control_dispatch_imsg(int fd, short event, void *arg) } } if (event & EV_WRITE) { - if (msgbuf_write(&c->iev.ibuf.w) < 0 && errno != EAGAIN) { + if (msgbuf_write(&c->iev.ibuf.w) <= 0 && errno != EAGAIN) { control_close(c); return; } diff --git a/usr.sbin/snmpd/proc.c b/usr.sbin/snmpd/proc.c index c10dcd09c37..5f692fcad0d 100644 --- a/usr.sbin/snmpd/proc.c +++ b/usr.sbin/snmpd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.9 2014/05/08 13:04:28 blambert Exp $ */ +/* $OpenBSD: proc.c,v 1.10 2014/07/12 14:15:04 reyk Exp $ */ /* * Copyright (c) 2010 - 2014 Reyk Floeter @@ -464,7 +464,7 @@ proc_dispatch(int fd, short event, void *arg) } if (event & EV_WRITE) { - if (msgbuf_write(&ibuf->w) == -1 && errno != EAGAIN) + if (msgbuf_write(&ibuf->w) <= 0 && errno != EAGAIN) fatal(title); } -- 2.20.1