From 3e8872dc48c952eb75fea81e636a5ee35a66a2a2 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Wed, 29 Jul 2015 22:38:25 +0900 Subject: [PATCH] partial writes are successful --- sexp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sexp.c b/sexp.c index 630a2ee4..7e01ddff 100644 --- a/sexp.c +++ b/sexp.c @@ -1363,8 +1363,10 @@ int sexp_buffered_flush (sexp ctx, sexp p, int forcep) { if (res > 0) { memmove(sexp_port_buf(p), sexp_port_buf(p) + res, off - res); sexp_port_offset(p) = off - res; + res = 0; + } else { + res = -1; } - res = -1; } else { sexp_port_offset(p) = 0; res = 0;