warp-vpn

point to point VPN implementation
git clone git://git.2f30.org/warp-vpn
Log | Files | Refs | README

commit 760c3208a6cc8af2943f38b6beb04a3a904539dc
parent 3392c12da9644ff918148ff4f20013ad84ca81b8
Author: sin <sin@2f30.org>
Date:   Wed, 13 Apr 2016 16:28:32 +0100

simplify error handling

Diffstat:
Mnetpkt.c | 4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/netpkt.c b/netpkt.c @@ -160,9 +160,7 @@ netread(int fd, unsigned char *pt, size_t ptlen, size_t *outlen) } } out: - if (n == 0) - return PKTFAILED; - if (errno == EWOULDBLOCK) + if (n < 0 && errno == EWOULDBLOCK) return PKTPARTIAL; return PKTFAILED; }