]> git.proxmox.com Git - mirror_ovs.git/commit
fatal-signal: Fix clang error due to lock.
authorWilliam Tu <u9012063@gmail.com>
Tue, 24 Mar 2020 14:17:02 +0000 (07:17 -0700)
committerWilliam Tu <u9012063@gmail.com>
Tue, 24 Mar 2020 14:46:37 +0000 (07:46 -0700)
commitecbc7f0aa2e112afc5ce63cf8a20ebd41e20b73b
tree71a73456559a680edbfd7d0bcee08962806bc3fc
parentae2d6e3f5b066fe0f64a3c03b68501022450ad30
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>
include/openvswitch/vlog.h
lib/fatal-signal.c
lib/vlog.c