]> git.sur5r.net Git - openocd/commitdiff
logging: turn of stdout/stderr buffering
authorØyvind Harboe <oyvind.harboe@zylin.com>
Fri, 17 Sep 2010 23:37:42 +0000 (01:37 +0200)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Mon, 20 Sep 2010 18:45:48 +0000 (20:45 +0200)
with this buffering disabled fancier logging scripts will
be able to process each line as it is output.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
src/main.c

index a71977daf9041e896599c5a1050c2525328414f3..9c7191d6e3e4e34daf1e13230d8cee3c48f6f01e 100644 (file)
@@ -35,5 +35,9 @@
 
 int main(int argc, char *argv[])
 {
+       /* disable buffering otherwise piping to logs causes problems work */
+       setvbuf(stdout, NULL, _IONBF, 0);
+       setvbuf(stderr, NULL, _IONBF, 0);
+
        return openocd_main(argc, argv);
 }