From e3dd0ac936eb8076d6ff0c227a77627fed447d98 Mon Sep 17 00:00:00 2001 From: sin Date: Wed, 1 Oct 2014 15:41:55 +0100 Subject: Break after we cancel the rx transfer --- ratox.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'ratox.c') diff --git a/ratox.c b/ratox.c index 955d75e..0dc069a 100644 --- a/ratox.c +++ b/ratox.c @@ -549,12 +549,17 @@ cbfiledata(Tox *m, int32_t frnum, uint8_t fnum, const uint8_t *data, uint16_t le while (len > 0) { n = write(f->fd[FFILE_OUT], &data[wrote], len); if (n < 0) { - if (errno == EPIPE) + if (errno == EPIPE) { cancelrxtransfer(f); - if (errno == EWOULDBLOCK) + break; + } else if (errno == EWOULDBLOCK) { continue; - } else if (n == 0) + } + weprintf("write:"); break; + } else if (n == 0) { + break; + } wrote += n; len -= n; } -- cgit v1.2.3