Clients are intended to use the OVSDB log code by reading zero or more
records and then writing zero or more records, but not reading after any
write has occurred.  Until now, ovsdb_log_read() has signaled the latter
behavior as an error.  Upcoming changes to OVSDB are going to make it an
expected behavior in some cases, so this commit changes it so that it
just becomes an empty read.

Signed-off-by: Ben Pfaff <[email protected]>
---
 ovsdb/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ovsdb/log.c b/ovsdb/log.c
index f95075034b3d..6a1a4484ad34 100644
--- a/ovsdb/log.c
+++ b/ovsdb/log.c
@@ -296,7 +296,7 @@ ovsdb_log_read(struct ovsdb_log *file, struct json **jsonp)
     if (file->read_error) {
         return ovsdb_error_clone(file->read_error);
     } else if (file->mode == OVSDB_LOG_WRITE) {
-        return OVSDB_BUG("reading file in write mode");
+        return NULL;
     }
 
     if (!fgets(header, sizeof header, file->stream)) {
-- 
2.10.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to