From c824892bf34e64c02f62ede24200131a23005462 Mon Sep 17 00:00:00 2001 From: sin Date: Wed, 24 Sep 2014 15:01:41 +0100 Subject: Keep trying to write until we succeed --- ratox.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ratox.c') diff --git a/ratox.c b/ratox.c index 4311940..fded6b3 100644 --- a/ratox.c +++ b/ratox.c @@ -543,10 +543,14 @@ cbfiledata(Tox *m, int32_t fid, uint8_t fnum, const uint8_t *data, uint16_t len, if (!f) return; +again: n = write(f->fd[FFILE_OUT], data, len); - if (n < 0) + if (n < 0) { if (errno == EPIPE) cancelrxtransfer(f); + if (errno == EWOULDBLOCK) + goto again; + } } static void -- cgit v1.2.3