]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common: disable journald logging backend if struct msghdr is not found 40607/head
authorKefu Chai <kchai@redhat.com>
Tue, 6 Apr 2021 05:09:13 +0000 (13:09 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 6 Apr 2021 06:46:33 +0000 (14:46 +0800)
commit80c4a1cd37298c2b63de01de9615025ce9f734ce
tree717d115e2745fbe09b868c0a4a7b8c1f1c142883
parent9f94d27752b33c85cda87f275ad7296398043fd4
common: disable journald logging backend if struct msghdr is not found

* cmake/modules/CephChecks.cmake: detect the existence of struct msghdr,
  define HAVE_MSGHDR if it is found
* src/common/CMakeLists.txt: do not compile journald.cc if HAVE_MSGHDR
  is FALSE. as in that case, we cannot use sendmsg() to write to
  journald unix domain socket
* src/test/CMakeLists.txt, src/test/common/CMakeLists.txt: disable test
  exercising journald logging backend if HAVE_MSGHDR is not defined
* src/common/Journald.h: define a dummy JournaldLogger and a dummy
  JournaldClusterLogger when HAVE_MSGHDR is not defined, in order to
  minimize the change in Log.h and Log.cc, otherwise the source code of
  Log.h and Log.cc would be segmented into smaller chunks by
  `ifdef HAVE_MSGHDR` macros.
* src/include/config-h.in.cmake: define a new macro named
  HAVE_MSGHDR.

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/CephChecks.cmake
src/common/CMakeLists.txt
src/common/Journald.h
src/include/config-h.in.cmake
src/test/CMakeLists.txt
src/test/common/CMakeLists.txt