summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-09-24 15:07:15 +0100
committersin <sin@2f30.org>2014-09-24 15:07:15 +0100
commite0aab53c93d73658e2ba20e113290f1640ba1e75 (patch)
tree655298b895c259631976e1536f911c3d7172e9ba /ratox.c
parentc824892bf34e64c02f62ede24200131a23005462 (diff)
Do it in the same order as in cancelrxtransfer()
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ratox.c b/ratox.c
index fded6b3..fb9c36d 100644
--- a/ratox.c
+++ b/ratox.c
@@ -491,13 +491,13 @@ cbfilecontrol(Tox *m, int32_t fid, uint8_t rec_sen, uint8_t fnum, uint8_t ctrlty
/* Receiving completed */
printout("Transfer complete\n");
tox_file_send_control(tox, f->fid, 1, 0, TOX_FILECONTROL_FINISHED, NULL, 0);
- ftruncate(f->fd[FFILE_PENDING], 0);
- dprintf(f->fd[FFILE_PENDING], "%d\n", 0);
- f->recvfileactive = 0;
if (f->fd[FFILE_OUT] != -1) {
close(f->fd[FFILE_OUT]);
f->fd[FFILE_OUT] = -1;
}
+ ftruncate(f->fd[FFILE_PENDING], 0);
+ dprintf(f->fd[FFILE_PENDING], "%d\n", 0);
+ f->recvfileactive = 0;
}
break;
default: