LCOV - code coverage report
Current view: top level - source3/lib - cluster_support.c (source / functions) Hit Total Coverage
Test: coverage report for master 2b515b7d Lines: 8 11 72.7 %
Date: 2024-02-28 12:06:22 Functions: 2 3 66.7 %

          Line data    Source code
       1             : /*
       2             :    Unix SMB/CIFS implementation.
       3             :    Copyright (C) 2014 Stefan Metzmacher
       4             : 
       5             :    This program is free software; you can redistribute it and/or modify
       6             :    it under the terms of the GNU General Public License as published by
       7             :    the Free Software Foundation; either version 3 of the License, or
       8             :    (at your option) any later version.
       9             : 
      10             :    This program is distributed in the hope that it will be useful,
      11             :    but WITHOUT ANY WARRANTY; without even the implied warranty of
      12             :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      13             :    GNU General Public License for more details.
      14             : 
      15             :    You should have received a copy of the GNU General Public License
      16             :    along with this program.  If not, see <http://www.gnu.org/licenses/>.
      17             : */
      18             : 
      19             : #include "includes.h"
      20             : #include <tdb.h>
      21             : #include "cluster_support.h"
      22             : 
      23             : #ifdef CLUSTER_SUPPORT
      24             : #include <ctdb_protocol.h>
      25             : #endif
      26             : 
      27           0 : bool cluster_support_available(void)
      28             : {
      29             : #ifdef CLUSTER_SUPPORT
      30             :         return true;
      31             : #else
      32           0 :         return false;
      33             : #endif
      34             : }
      35             : 
      36          50 : const char *cluster_support_features(void)
      37             : {
      38             : #define _LINE_DEF(x) "   " #x "\n"
      39             : #define _LINE_STR(x) "   " #x ": " x "\n"
      40             : #define _LINE_INT(x) "   " #x ": " __STRINGSTRING(x) "\n"
      41           2 :         static const char *v = "Cluster support features:\n"
      42             : #ifdef CLUSTER_SUPPORT
      43             :         _LINE_DEF(CLUSTER_SUPPORT)
      44             : #else
      45             :         "   NONE\n"
      46             : #endif
      47             : #ifdef CTDB_SOCKET
      48             :         _LINE_STR(CTDB_SOCKET)
      49             : #endif
      50             : #ifdef CTDB_PROTOCOL
      51             :         _LINE_INT(CTDB_PROTOCOL)
      52             : #endif
      53             :         "";
      54             : 
      55          50 :         return v;
      56             : }
      57             : 
      58          58 : const char *lp_ctdbd_socket(void)
      59             : {
      60           2 :         const char *ret;
      61             : 
      62          58 :         ret = lp__ctdbd_socket();
      63          58 :         if (ret != NULL && strlen(ret) > 0) {
      64           0 :                 return ret;
      65             :         }
      66             : 
      67             : #ifdef CTDB_SOCKET
      68             :         return CTDB_SOCKET;
      69             : #else
      70          56 :         return "";
      71             : #endif
      72             : }

Generated by: LCOV version 1.14