test-ovsdb: Fix setvbuf incompatibility on Windows.
authorGurucharan Shetty <gshetty@nicira.com>
Mon, 12 May 2014 16:38:48 +0000 (09:38 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Wed, 14 May 2014 21:48:34 +0000 (14:48 -0700)
setvbuf() in Windows treats _IOLBF to be the same as _IOFBF. So
we cannot have size as zero (otherwise, there is a crash).

Workaround is to set _IONBF. I don't see unit test failures
because of the change.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
tests/test-ovsdb.c

index 29d7542..ebb24c0 100644 (file)
@@ -1893,7 +1893,7 @@ do_idl(int argc, char *argv[])
         rpc = NULL;
     }
 
-    setvbuf(stdout, NULL, _IOLBF, 0);
+    setvbuf(stdout, NULL, _IONBF, 0);
 
     symtab = ovsdb_symbol_table_create();
     for (i = 2; i < argc; i++) {