summaryrefslogtreecommitdiff
path: root/ovsdb
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2017-12-06 12:36:44 -0800
committerBen Pfaff <blp@ovn.org>2017-12-24 11:56:23 -0800
commit875f8c13cb401e55fb02c200f8b3febc7d2ac9b6 (patch)
tree7fde3f74d6b504d5e9ba76a53d1092ba44ba882e /ovsdb
parent1e0b7e94ecf35e06037b00099fa2f23e13954b99 (diff)
downloadopenvswitch-875f8c13cb401e55fb02c200f8b3febc7d2ac9b6.tar.gz
log: Make reading in writing mode less of an error.
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 <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'ovsdb')
-rw-r--r--ovsdb/log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ovsdb/log.c b/ovsdb/log.c
index b7f822274..1cbd24f16 100644
--- a/ovsdb/log.c
+++ b/ovsdb/log.c
@@ -298,7 +298,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)) {