From 8fdbe6c876e9e2358c3b045c1ad6edd4a34a7436 Mon Sep 17 00:00:00 2001 From: sin Date: Wed, 24 Sep 2014 17:05:08 +0100 Subject: Use unbuffered stdout --- ratox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ratox.c b/ratox.c index 00f609d..405c170 100644 --- a/ratox.c +++ b/ratox.c @@ -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]); @@ -1423,6 +1421,8 @@ main(int argc, char *argv[]) signal(SIGTERM, initshutdown); signal(SIGPIPE, SIG_IGN); + setbuf(stdout, NULL); + printrat(); toxinit(); localinit(); -- cgit v1.2.3