diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-06-29 15:02:31 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-06-29 15:02:31 +0200 |
commit | 24cbb7fda2486ee9d2ae8e145d6ff8fe19df92b0 (patch) | |
tree | 243f60886e42d6e0ab771aa8a08faeb508ea7489 /src/util/common_logging.c | |
parent | 14b6de39c4316bb488d47dc07208a77dd0a85ef2 (diff) | |
download | gnunet-24cbb7fda2486ee9d2ae8e145d6ff8fe19df92b0.tar.gz gnunet-24cbb7fda2486ee9d2ae8e145d6ff8fe19df92b0.zip |
fix FTBFS issues if --enable-logging=no is set
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r-- | src/util/common_logging.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 7d5b50b8b..34481fe13 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -203,6 +203,8 @@ struct LogDef | |||
203 | int force; | 203 | int force; |
204 | }; | 204 | }; |
205 | 205 | ||
206 | |||
207 | #if !defined(GNUNET_CULL_LOGGING) | ||
206 | /** | 208 | /** |
207 | * Dynamic array of logging definitions | 209 | * Dynamic array of logging definitions |
208 | */ | 210 | */ |
@@ -219,19 +221,20 @@ static int logdefs_size; | |||
219 | static int logdefs_len; | 221 | static int logdefs_len; |
220 | 222 | ||
221 | /** | 223 | /** |
222 | * GNUNET_YES if GNUNET_LOG environment variable is already parsed. | 224 | * #GNUNET_YES if GNUNET_LOG environment variable is already parsed. |
223 | */ | 225 | */ |
224 | static int gnunet_log_parsed; | 226 | static int gnunet_log_parsed; |
225 | 227 | ||
226 | /** | 228 | /** |
227 | * GNUNET_YES if GNUNET_FORCE_LOG environment variable is already parsed. | 229 | * #GNUNET_YES if GNUNET_FORCE_LOG environment variable is already parsed. |
228 | */ | 230 | */ |
229 | static int gnunet_force_log_parsed; | 231 | static int gnunet_force_log_parsed; |
230 | 232 | ||
231 | /** | 233 | /** |
232 | * GNUNET_YES if at least one definition with forced == 1 is available. | 234 | * #GNUNET_YES if at least one definition with forced == 1 is available. |
233 | */ | 235 | */ |
234 | static int gnunet_force_log_present; | 236 | static int gnunet_force_log_present; |
237 | #endif | ||
235 | 238 | ||
236 | #ifdef WINDOWS | 239 | #ifdef WINDOWS |
237 | /** | 240 | /** |
@@ -269,18 +272,6 @@ get_type (const char *log) | |||
269 | } | 272 | } |
270 | 273 | ||
271 | 274 | ||
272 | #if !defined(GNUNET_CULL_LOGGING) | ||
273 | /** | ||
274 | * Utility function - reallocates logdefs array to be twice as large. | ||
275 | */ | ||
276 | static void | ||
277 | resize_logdefs () | ||
278 | { | ||
279 | logdefs_size = (logdefs_size + 1) * 2; | ||
280 | logdefs = GNUNET_realloc (logdefs, logdefs_size * sizeof (struct LogDef)); | ||
281 | } | ||
282 | |||
283 | |||
284 | /** | 275 | /** |
285 | * Abort the process, generate a core dump if possible. | 276 | * Abort the process, generate a core dump if possible. |
286 | */ | 277 | */ |
@@ -294,6 +285,18 @@ GNUNET_abort_ () | |||
294 | } | 285 | } |
295 | 286 | ||
296 | 287 | ||
288 | #if !defined(GNUNET_CULL_LOGGING) | ||
289 | /** | ||
290 | * Utility function - reallocates logdefs array to be twice as large. | ||
291 | */ | ||
292 | static void | ||
293 | resize_logdefs () | ||
294 | { | ||
295 | logdefs_size = (logdefs_size + 1) * 2; | ||
296 | logdefs = GNUNET_realloc (logdefs, logdefs_size * sizeof (struct LogDef)); | ||
297 | } | ||
298 | |||
299 | |||
297 | #if ! TALER_WALLET_ONLY | 300 | #if ! TALER_WALLET_ONLY |
298 | /** | 301 | /** |
299 | * Rotate logs, deleting the oldest log. | 302 | * Rotate logs, deleting the oldest log. |
@@ -715,7 +718,7 @@ GNUNET_log_setup (const char *comp, | |||
715 | log_file_name = GNUNET_STRINGS_filename_expand (logfile); | 718 | log_file_name = GNUNET_STRINGS_filename_expand (logfile); |
716 | if (NULL == log_file_name) | 719 | if (NULL == log_file_name) |
717 | return GNUNET_SYSERR; | 720 | return GNUNET_SYSERR; |
718 | #if TALER_WALLET_ONLY | 721 | #if TALER_WALLET_ONLY || defined(GNUNET_CULL_LOGGING) |
719 | /* log file option not allowed for wallet logic */ | 722 | /* log file option not allowed for wallet logic */ |
720 | GNUNET_assert (NULL == logfile); | 723 | GNUNET_assert (NULL == logfile); |
721 | return GNUNET_OK; | 724 | return GNUNET_OK; |
@@ -1030,7 +1033,7 @@ mylog (enum GNUNET_ErrorType kind, | |||
1030 | } | 1033 | } |
1031 | #endif | 1034 | #endif |
1032 | VSNPRINTF (buf, size, message, va); | 1035 | VSNPRINTF (buf, size, message, va); |
1033 | #if ! TALER_WALLET_ONLY | 1036 | #if ! (defined(GNUNET_CULL_LOGGING) || TALER_WALLET_ONLY) |
1034 | if (NULL != tmptr) | 1037 | if (NULL != tmptr) |
1035 | (void) setup_log_file (tmptr); | 1038 | (void) setup_log_file (tmptr); |
1036 | #endif | 1039 | #endif |