From: Peng He <hepeng.0...@bytedance.com>

async_append stores log_fd, it should be destructed before log_fd
is closed.

Signed-off-by: Peng He <hepeng.0...@bytedance.com>
---
 lib/vlog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/vlog.c b/lib/vlog.c
index e78c785f7..59b524b09 100644
--- a/lib/vlog.c
+++ b/lib/vlog.c
@@ -411,10 +411,10 @@ vlog_set_log_file__(char *new_log_file_name)
 
     /* Close old log file, if any. */
     ovs_mutex_lock(&log_file_mutex);
+    async_append_destroy(log_writer);
     if (log_fd >= 0) {
         close(log_fd);
     }
-    async_append_destroy(log_writer);
     free(log_file_name);
 
     /* Install new log file. */
-- 
2.39.2

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to