summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/buffer.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-12-26 17:13:53 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-12-26 17:13:53 +0000
commitc74c395fab2c3a665bc159a2266a67919fc1d960 (patch)
tree7d9499cf5f41837f1fd6a40375c883b5cce6d514 /usr.sbin/bgpd/buffer.c
parentc81c821f420f8a22f5e06d73349b08a5901993f2 (diff)
need to clean errno before returning error in the custom case
Diffstat (limited to 'usr.sbin/bgpd/buffer.c')
-rw-r--r--usr.sbin/bgpd/buffer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/buffer.c b/usr.sbin/bgpd/buffer.c
index 3cb2df56b38..bc0223b7f50 100644
--- a/usr.sbin/bgpd/buffer.c
+++ b/usr.sbin/bgpd/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.9 2003/12/24 13:28:01 henning Exp $ */
+/* $OpenBSD: buffer.c,v 1.10 2003/12/26 17:13:52 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -105,8 +105,10 @@ buf_write(int sock, struct buf *buf)
return (-1);
}
- if (n == 0) /* connection closed */
+ if (n == 0) { /* connection closed */
+ errno = 0;
return (-2);
+ }
if (n < buf->size - buf->rpos) { /* not all data written yet */
buf->rpos += n;