]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
fflush the new configurable stdout output to allow proper pipe/netcat setups.
authorhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 25 Nov 2009 18:51:31 +0000 (18:51 +0000)
committerhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 25 Nov 2009 18:51:31 +0000 (18:51 +0000)
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1091 030b6a49-0b11-0410-94ab-b0dab22257f2

can-utils/canplayer.c

index efce089fb9421c321bb6ba30d4c3c3bd42a6e85d..9494a6d44cf10efdd75f0e408267ea0baceeb9a7 100644 (file)
@@ -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);