From: Øyvind Harboe Date: Fri, 17 Sep 2010 23:37:42 +0000 (+0200) Subject: logging: turn of stdout/stderr buffering X-Git-Tag: v0.5.0-rc1~407 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=241fd0b5a8a95e814395f79b5ea7715c1862f045;hp=61780558e1654af0f3f20a332763b30bf533a912 logging: turn of stdout/stderr buffering with this buffering disabled fancier logging scripts will be able to process each line as it is output. Signed-off-by: Øyvind Harboe --- diff --git a/src/main.c b/src/main.c index a71977daf9..9c7191d6e3 100644 --- a/src/main.c +++ b/src/main.c @@ -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); }