From: hartkopp Date: Wed, 25 Nov 2009 18:51:31 +0000 (+0000) Subject: fflush the new configurable stdout output to allow proper pipe/netcat setups. X-Git-Url: http://rtime.felk.cvut.cz/gitweb/socketcan-devel.git/commitdiff_plain/ffcedeac8335f46e495e2fcabc665230e8955ac7 fflush the new configurable stdout output to allow proper pipe/netcat setups. git-svn-id: svn://svn.berlios.de//socketcan/trunk@1091 030b6a49-0b11-0410-94ab-b0dab22257f2 --- diff --git a/can-utils/canplayer.c b/can-utils/canplayer.c index efce089..9494a6d 100644 --- a/can-utils/canplayer.c +++ b/can-utils/canplayer.c @@ -423,11 +423,12 @@ int main(int argc, char **argv) txidx = get_txidx(device); } - if (txidx == STDOUTIDX) /* hook to print logfile lines on stdout */ + if (txidx == STDOUTIDX) { /* hook to print logfile lines on stdout */ printf("%s", buf); /* print the line AS-IS without extra \n */ + fflush(stdout); - else if (txidx > 0) { /* only send to valid CAN devices */ + } else if (txidx > 0) { /* only send to valid CAN devices */ if (parse_canframe(ascframe, &frame)) { fprintf(stderr, "wrong CAN frame format: '%s'!", ascframe);