diff options
author | sin <sin@2f30.org> | 2014-10-01 15:41:55 +0100 |
---|---|---|
committer | sin <sin@2f30.org> | 2014-10-01 15:41:55 +0100 |
commit | e3dd0ac936eb8076d6ff0c227a77627fed447d98 (patch) | |
tree | 96211d7ac1c7b8369c79f0c2b4904839cc092348 /ratox.c | |
parent | a4caeca88b7dff2e8a54e26aef1a812c95206e95 (diff) |
Break after we cancel the rx transfer
Diffstat (limited to 'ratox.c')
-rw-r--r-- | ratox.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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; } |