From: Eric Bollengier Date: Wed, 17 Aug 2022 08:05:24 +0000 (+0200) Subject: Fix compilation warning X-Git-Tag: Beta-15.0.0~527 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cceca32608d06d3ad8b5aa77a1df687dd022eabd;p=thirdparty%2Fbacula.git Fix compilation warning --- diff --git a/bacula/src/filed/status.c b/bacula/src/filed/status.c index b28b060da..f94932ce4 100644 --- a/bacula/src/filed/status.c +++ b/bacula/src/filed/status.c @@ -25,6 +25,9 @@ #include "bacula.h" #include "filed.h" + +#define USE_LIST_TERMINATED_JOBS +#define USE_LIST_RESOURCE_LIMITS #include "lib/status.h" extern bool GetWindowsVersionString(char *buf, int maxsiz); diff --git a/bacula/src/lib/bpipe.c b/bacula/src/lib/bpipe.c index 136ca5b75..4840111be 100644 --- a/bacula/src/lib/bpipe.c +++ b/bacula/src/lib/bpipe.c @@ -167,6 +167,9 @@ BPIPE *open_bpipe(char *prog, int wait, const char *mode, char *envp[]) * to determine the FD list to close. */ #if !defined(HAVE_FCNTL_F_CLOSEM) && !defined(HAVE_CLOSEFROM) + struct rlimit rl; + int64_t rlimitResult=0; + if (getrlimit(RLIMIT_NOFILE, &rl) == -1) { rlimitResult = sysconf(_SC_OPEN_MAX); } else { diff --git a/bacula/src/lib/status.h b/bacula/src/lib/status.h index 2582ed524..9c04390d0 100644 --- a/bacula/src/lib/status.h +++ b/bacula/src/lib/status.h @@ -57,6 +57,7 @@ static void sendit(const char *msg, int len, STATUS_PKT *sp) } /* common to SD/FD */ +#ifdef USE_LIST_TERMINATED_JOBS static void list_terminated_jobs(STATUS_PKT *sp) { OutputWriter ow(sp->api_opts); @@ -196,8 +197,10 @@ static void list_terminated_jobs(STATUS_PKT *sp) sendit(p, strlen(p), sp); } } +#endif /* USE_LIST_TERMINATED_JOBS */ /* common to SD/FD/DIR */ +#ifdef USE_LIST_RESOURCE_LIMITS static void list_resource_limits(STATUS_PKT *sp, int64_t l_nofile, int64_t l_memlock) { #ifdef HAVE_GETRLIMIT @@ -263,6 +266,7 @@ static void list_resource_limits(STATUS_PKT *sp, int64_t l_nofile, int64_t l_mem } #endif } +#endif /* USE_LIST_RESOURCE_LIMITS */ #if defined(HAVE_WIN32) int bacstat = 0; diff --git a/bacula/src/lib/store_mngr_cmds.h b/bacula/src/lib/store_mngr_cmds.h index 083a35c31..3a044294f 100644 --- a/bacula/src/lib/store_mngr_cmds.h +++ b/bacula/src/lib/store_mngr_cmds.h @@ -26,7 +26,10 @@ static const char store_query[] = "store_mngr query\n"; static const char store_query_freespace[] = "store_mngr freespace device=%s\n"; static char OK_store_query[] = "3000 OK query store\n"; -static char store_query_unsupp_policy[] = "3200 unsupported policy\n"; static char OK_store_size[] = "3000 OK size=%llu\n"; +#ifdef STORAGE_DAEMON +static char store_query_unsupp_policy[] = "3200 unsupported policy\n"; +#endif + #endif // STORE_MNGR_CMDS_H diff --git a/bacula/src/stored/status.c b/bacula/src/stored/status.c index 712fa0dd1..c408b27c1 100644 --- a/bacula/src/stored/status.c +++ b/bacula/src/stored/status.c @@ -26,6 +26,9 @@ #include "bacula.h" #include "stored.h" + +#define USE_LIST_TERMINATED_JOBS +#define USE_LIST_RESOURCE_LIMITS #include "lib/status.h" #include "sd_plugins.h"