summaryrefslogtreecommitdiff
path: root/ovsdb/file.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2017-12-13 11:32:28 -0800
committerBen Pfaff <blp@ovn.org>2017-12-13 11:32:29 -0800
commit3865965dd99325bd7bcd5bd3ab2a5d059dd4832e (patch)
tree53341d4fb9f22465871db4d83b92babb9012b5a2 /ovsdb/file.c
parentdc92f724d4641bcf9fce95db262f314264e473af (diff)
downloadopenvswitch-3865965dd99325bd7bcd5bd3ab2a5d059dd4832e.tar.gz
ovsdb-error: New function ovsdb_error_to_string_free().
This allows slight code simplifications across the tree. Signed-off-by: Ben Pfaff <blp@ovn.org> Tested-by: Yifeng Sun <pkusunyifeng@gmail.com> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Diffstat (limited to 'ovsdb/file.c')
-rw-r--r--ovsdb/file.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ovsdb/file.c b/ovsdb/file.c
index 6a406da2a..2f07bba3d 100644
--- a/ovsdb/file.c
+++ b/ovsdb/file.c
@@ -237,11 +237,9 @@ ovsdb_file_open__(const char *file_name,
/* Log error but otherwise ignore it. Probably the database just got
* truncated due to power failure etc. and we should use its current
* contents. */
- char *msg = ovsdb_error_to_string(error);
+ char *msg = ovsdb_error_to_string_free(error);
VLOG_ERR("%s", msg);
free(msg);
-
- ovsdb_error_destroy(error);
}
if (!read_only) {
@@ -608,8 +606,7 @@ ovsdb_file_commit(struct ovsdb_replica *replica,
{
error = ovsdb_file_compact(file);
if (error) {
- char *s = ovsdb_error_to_string(error);
- ovsdb_error_destroy(error);
+ char *s = ovsdb_error_to_string_free(error);
VLOG_WARN("%s: compacting database failed (%s), retrying in "
"%d seconds",
file->file_name, s, COMPACT_RETRY_MSEC / 1000);