diff options
author | Ben Pfaff <blp@nicira.com> | 2009-11-06 13:38:00 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2009-11-06 15:33:47 -0800 |
commit | 9f2cfbfef3ce2052198a2323e443e469b18295b8 (patch) | |
tree | 8a2fe99ba5ee00cafc68dba8a6dca5a72250a292 /ovsdb/ovsdb.c | |
parent | 1248fcd24a6870460441aadcf2039c86dfea0af6 (diff) |
ovsdb: Fix inverted logic in ovsdb_open().
We want ovsdb_create() (and thus, the open database) to receive the file
only if it is a read-write database. If it is read-only, then there is
no need to keep the file around, since we will never read or write it
after opening the database.
Diffstat (limited to 'ovsdb/ovsdb.c')
-rw-r--r-- | ovsdb/ovsdb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ovsdb/ovsdb.c b/ovsdb/ovsdb.c index 1a4b6d8d..6d0f131e 100644 --- a/ovsdb/ovsdb.c +++ b/ovsdb/ovsdb.c @@ -204,7 +204,7 @@ ovsdb_open(const char *file_name, bool read_only, struct ovsdb **dbp) } json_destroy(json); - db = ovsdb_create(read_only ? file : NULL, schema); + db = ovsdb_create(read_only ? NULL : file, schema); while ((error = ovsdb_file_read(file, &json)) == NULL && json) { struct ovsdb_txn *txn; |