ovsdb: Open database in binary mode.
authorGurucharan Shetty <gshetty@nicira.com>
Thu, 8 May 2014 20:31:18 +0000 (13:31 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Wed, 14 May 2014 21:45:19 +0000 (14:45 -0700)
Some ovsdb-tool related unit tests fail with bad checksum errors
while reading transactions from database. It is most likely because
of the CR at the end of line. Using binary mode solves the problem.

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

index 48fa847..1e4c75e 100644 (file)
@@ -108,6 +108,9 @@ ovsdb_log_open(const char *name, enum ovsdb_log_open_mode open_mode,
     } else {
         OVS_NOT_REACHED();
     }
+#ifdef _WIN32
+    flags = flags | O_BINARY;
+#endif
     fd = open(name, flags, 0666);
     if (fd < 0) {
         const char *op = open_mode == OVSDB_LOG_CREATE ? "create" : "open";