diff options
author | William Tu <u9012063@gmail.com> | 2020-03-24 07:17:02 -0700 |
---|---|---|
committer | William Tu <u9012063@gmail.com> | 2020-03-24 07:46:37 -0700 |
commit | ecbc7f0aa2e112afc5ce63cf8a20ebd41e20b73b (patch) | |
tree | 71a73456559a680edbfd7d0bcee08962806bc3fc /include/openvswitch | |
parent | ae2d6e3f5b066fe0f64a3c03b68501022450ad30 (diff) | |
download | openvswitch-ecbc7f0aa2e112afc5ce63cf8a20ebd41e20b73b.tar.gz |
fatal-signal: Fix clang error due to lock.
Due to not acquiring lock, clang reports:
lib/vlog.c:618:12: error: reading variable 'log_fd' requires holding mutex
'log_file_mutex' [-Werror,-Wthread-safety-analysis]
return log_fd;
The patch fixes it by creating a function in vlog.c to write
directly to log file unsafely.
Tested-at: https://travis-ci.org/github/williamtu/ovs-travis/builds/666165883
Fixes: ecd4a8fcdff2 ("fatal-signal: Log backtrace when no monitor daemon.")
Suggested-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: William Tu <u9012063@gmail.com>
Diffstat (limited to 'include/openvswitch')
-rw-r--r-- | include/openvswitch/vlog.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/openvswitch/vlog.h b/include/openvswitch/vlog.h index 476bf3d6d..886fce5e0 100644 --- a/include/openvswitch/vlog.h +++ b/include/openvswitch/vlog.h @@ -143,8 +143,8 @@ void vlog_set_syslog_method(const char *method); /* Configure syslog target. */ void vlog_set_syslog_target(const char *target); -/* Return the log_fd. */ -int vlog_get_fd(void); +/* Write directly to log file. */ +void vlog_direct_write_to_log_file_unsafe(const char *s); /* Initialization. */ void vlog_init(void); |