tUse unbuffered stdout - ratox - FIFO based tox client
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 8fdbe6c876e9e2358c3b045c1ad6edd4a34a7436
(DIR) parent c28164d21d377a4e5327ddcc2bedc9cd356f772a
(HTM) Author: sin <sin@2f30.org>
Date: Wed, 24 Sep 2014 17:05:08 +0100
Use unbuffered stdout
Diffstat:
M ratox.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/ratox.c b/ratox.c
t@@ -485,14 +485,12 @@ cbfilecontrol(Tox *m, int32_t fid, uint8_t rec_sen, uint8_t fnum, uint8_t ctrlty
break;
case TOX_FILECONTROL_FINISHED:
if (rec_sen == 1) {
- /* Sending completed */
- printout("Transfer complete\n");
+ printout("TX transfer complete\n");
f->t.state = TRANSFER_NONE;
free(f->t.buf);
f->t.buf = NULL;
} else {
- /* Receiving completed */
- printout("Transfer complete\n");
+ printout("RX transfer complete\n");
tox_file_send_control(tox, f->fid, 1, 0, TOX_FILECONTROL_FINISHED, NULL, 0);
if (f->fd[FFILE_OUT] != -1) {
close(f->fd[FFILE_OUT]);
t@@ -1423,6 +1421,8 @@ main(int argc, char *argv[])
signal(SIGTERM, initshutdown);
signal(SIGPIPE, SIG_IGN);
+ setbuf(stdout, NULL);
+
printrat();
toxinit();
localinit();