aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-06-29 15:02:31 +0200
committerChristian Grothoff <christian@grothoff.org>2017-06-29 15:02:31 +0200
commit24cbb7fda2486ee9d2ae8e145d6ff8fe19df92b0 (patch)
tree243f60886e42d6e0ab771aa8a08faeb508ea7489
parent14b6de39c4316bb488d47dc07208a77dd0a85ef2 (diff)
downloadgnunet-24cbb7fda2486ee9d2ae8e145d6ff8fe19df92b0.tar.gz
gnunet-24cbb7fda2486ee9d2ae8e145d6ff8fe19df92b0.zip
fix FTBFS issues if --enable-logging=no is set
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c2
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c4
-rw-r--r--src/cadet/gnunet-service-cadet_tunnels.c4
-rw-r--r--src/util/bandwidth.c23
-rw-r--r--src/util/common_logging.c37
-rw-r--r--src/util/crypto_ecc_setup.c6
-rw-r--r--src/util/gnunet-service-resolver.c3
-rw-r--r--src/util/resolver_api.c2
-rw-r--r--src/util/test_common_logging_dummy.c4
9 files changed, 55 insertions, 30 deletions
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index 739b68228..1a2b32be0 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -2049,6 +2049,7 @@ void
2049GCCH_debug (struct CadetChannel *ch, 2049GCCH_debug (struct CadetChannel *ch,
2050 enum GNUNET_ErrorType level) 2050 enum GNUNET_ErrorType level)
2051{ 2051{
2052#if !defined(GNUNET_CULL_LOGGING)
2052 int do_log; 2053 int do_log;
2053 2054
2054 do_log = GNUNET_get_log_call_status (level & (~GNUNET_ERROR_TYPE_BULK), 2055 do_log = GNUNET_get_log_call_status (level & (~GNUNET_ERROR_TYPE_BULK),
@@ -2088,6 +2089,7 @@ GCCH_debug (struct CadetChannel *ch,
2088 ntohl (ch->mid_recv.mid), 2089 ntohl (ch->mid_recv.mid),
2089 (unsigned long long) ch->mid_futures, 2090 (unsigned long long) ch->mid_futures,
2090 ntohl (ch->mid_send.mid)); 2091 ntohl (ch->mid_send.mid));
2092#endif
2091} 2093}
2092 2094
2093 2095
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 7b66f61a2..82ab5cc2c 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -1066,6 +1066,7 @@ void
1066GCC_debug (struct CadetConnection *cc, 1066GCC_debug (struct CadetConnection *cc,
1067 enum GNUNET_ErrorType level) 1067 enum GNUNET_ErrorType level)
1068{ 1068{
1069#if !defined(GNUNET_CULL_LOGGING)
1069 int do_log; 1070 int do_log;
1070 1071
1071 do_log = GNUNET_get_log_call_status (level & (~GNUNET_ERROR_TYPE_BULK), 1072 do_log = GNUNET_get_log_call_status (level & (~GNUNET_ERROR_TYPE_BULK),
@@ -1086,6 +1087,7 @@ GCC_debug (struct CadetConnection *cc,
1086 GCPP_2s (cc->path), 1087 GCPP_2s (cc->path),
1087 cc->state, 1088 cc->state,
1088 (GNUNET_YES == cc->mqm_ready) ? "ready" : "busy"); 1089 (GNUNET_YES == cc->mqm_ready) ? "ready" : "busy");
1090#endif
1089} 1091}
1090 1092
1091/* end of gnunet-service-cadet-new_connection.c */ 1093/* end of gnunet-service-cadet_connection.c */
diff --git a/src/cadet/gnunet-service-cadet_tunnels.c b/src/cadet/gnunet-service-cadet_tunnels.c
index 28004debc..22e19ef70 100644
--- a/src/cadet/gnunet-service-cadet_tunnels.c
+++ b/src/cadet/gnunet-service-cadet_tunnels.c
@@ -3404,6 +3404,7 @@ void
3404GCT_debug (const struct CadetTunnel *t, 3404GCT_debug (const struct CadetTunnel *t,
3405 enum GNUNET_ErrorType level) 3405 enum GNUNET_ErrorType level)
3406{ 3406{
3407#if !defined(GNUNET_CULL_LOGGING)
3407 struct CadetTConnection *iter_c; 3408 struct CadetTConnection *iter_c;
3408 int do_log; 3409 int do_log;
3409 3410
@@ -3435,7 +3436,8 @@ GCT_debug (const struct CadetTunnel *t,
3435 3436
3436 LOG2 (level, 3437 LOG2 (level,
3437 "TTT TUNNEL END\n"); 3438 "TTT TUNNEL END\n");
3439#endif
3438} 3440}
3439 3441
3440 3442
3441/* end of gnunet-service-cadet-new_tunnels.c */ 3443/* end of gnunet-service-cadet_tunnels.c */
diff --git a/src/util/bandwidth.c b/src/util/bandwidth.c
index bc0c3b9b4..f551bbb82 100644
--- a/src/util/bandwidth.c
+++ b/src/util/bandwidth.c
@@ -327,7 +327,6 @@ static void
327update_tracker (struct GNUNET_BANDWIDTH_Tracker *av) 327update_tracker (struct GNUNET_BANDWIDTH_Tracker *av)
328{ 328{
329 struct GNUNET_TIME_Absolute now; 329 struct GNUNET_TIME_Absolute now;
330 struct GNUNET_TIME_Relative delta;
331 uint64_t delta_time; 330 uint64_t delta_time;
332 uint64_t delta_avail; 331 uint64_t delta_avail;
333 uint64_t left_bytes; 332 uint64_t left_bytes;
@@ -354,14 +353,20 @@ update_tracker (struct GNUNET_BANDWIDTH_Tracker *av)
354 else 353 else
355 av->consumption_since_last_update__ = - max_carry; 354 av->consumption_since_last_update__ = - max_carry;
356 } 355 }
357 delta.rel_value_us = delta_time; 356#if !defined(GNUNET_CULL_LOGGING)
358 LOG (GNUNET_ERROR_TYPE_DEBUG, 357 {
359 "Tracker %p updated, consumption at %lld at %u Bps, last update was %s ago\n", 358 struct GNUNET_TIME_Relative delta;
360 av, 359
361 (long long) av->consumption_since_last_update__, 360 delta.rel_value_us = delta_time;
362 (unsigned int) av->available_bytes_per_s__, 361 LOG (GNUNET_ERROR_TYPE_DEBUG,
363 GNUNET_STRINGS_relative_time_to_string (delta, 362 "Tracker %p updated, consumption at %lld at %u Bps, last update was %s ago\n",
364 GNUNET_YES)); 363 av,
364 (long long) av->consumption_since_last_update__,
365 (unsigned int) av->available_bytes_per_s__,
366 GNUNET_STRINGS_relative_time_to_string (delta,
367 GNUNET_YES));
368 }
369#endif
365} 370}
366 371
367 372
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;
219static int logdefs_len; 221static 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 */
224static int gnunet_log_parsed; 226static 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 */
229static int gnunet_force_log_parsed; 231static 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 */
234static int gnunet_force_log_present; 236static 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 */
276static void
277resize_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 */
292static void
293resize_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
diff --git a/src/util/crypto_ecc_setup.c b/src/util/crypto_ecc_setup.c
index 2f2e2f122..64610ddd3 100644
--- a/src/util/crypto_ecc_setup.c
+++ b/src/util/crypto_ecc_setup.c
@@ -119,7 +119,8 @@ GNUNET_CRYPTO_eddsa_key_create_from_file (const char *filename)
119 { 119 {
120 ec = errno; 120 ec = errno;
121 LOG (GNUNET_ERROR_TYPE_ERROR, 121 LOG (GNUNET_ERROR_TYPE_ERROR,
122 _("Could not acquire lock on file `%s': %s...\n"), filename, 122 _("Could not acquire lock on file `%s': %s...\n"),
123 filename,
123 STRERROR (ec)); 124 STRERROR (ec));
124 } 125 }
125 } 126 }
@@ -313,7 +314,8 @@ GNUNET_CRYPTO_ecdsa_key_create_from_file (const char *filename)
313 { 314 {
314 ec = errno; 315 ec = errno;
315 LOG (GNUNET_ERROR_TYPE_ERROR, 316 LOG (GNUNET_ERROR_TYPE_ERROR,
316 _("Could not acquire lock on file `%s': %s...\n"), filename, 317 _("Could not acquire lock on file `%s': %s...\n"),
318 filename,
317 STRERROR (ec)); 319 STRERROR (ec));
318 LOG (GNUNET_ERROR_TYPE_ERROR, 320 LOG (GNUNET_ERROR_TYPE_ERROR,
319 _ 321 _
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c
index 12e484845..d26bdd212 100644
--- a/src/util/gnunet-service-resolver.c
+++ b/src/util/gnunet-service-resolver.c
@@ -666,6 +666,8 @@ handle_get (void *cls,
666 return; 666 return;
667 } 667 }
668 ip = &msg[1]; 668 ip = &msg[1];
669
670#if !defined(GNUNET_CULL_LOGGING)
669 { 671 {
670 char buf[INET6_ADDRSTRLEN]; 672 char buf[INET6_ADDRSTRLEN];
671 673
@@ -676,6 +678,7 @@ handle_get (void *cls,
676 buf, 678 buf,
677 sizeof (buf))); 679 sizeof (buf)));
678 } 680 }
681#endif
679 get_ip_as_string (client, 682 get_ip_as_string (client,
680 af, 683 af,
681 ip); 684 ip);
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c
index 0c915932c..e7bba3000 100644
--- a/src/util/resolver_api.c
+++ b/src/util/resolver_api.c
@@ -821,6 +821,7 @@ handle_lookup_timeout (void *cls)
821 } 821 }
822 else 822 else
823 { 823 {
824#if !defined(GNUNET_CULL_LOGGING)
824 char buf[INET6_ADDRSTRLEN]; 825 char buf[INET6_ADDRSTRLEN];
825 826
826 LOG (GNUNET_ERROR_TYPE_INFO, 827 LOG (GNUNET_ERROR_TYPE_INFO,
@@ -829,6 +830,7 @@ handle_lookup_timeout (void *cls)
829 (const void *) &rh[1], 830 (const void *) &rh[1],
830 buf, 831 buf,
831 sizeof(buf))); 832 sizeof(buf)));
833#endif
832 if (GNUNET_NO == rh->received_response) 834 if (GNUNET_NO == rh->received_response)
833 { 835 {
834 char *nret; 836 char *nret;
diff --git a/src/util/test_common_logging_dummy.c b/src/util/test_common_logging_dummy.c
index 0d971eac5..cb191ddab 100644
--- a/src/util/test_common_logging_dummy.c
+++ b/src/util/test_common_logging_dummy.c
@@ -47,11 +47,15 @@ my_log (void *ctx, enum GNUNET_ErrorType kind, const char *component,
47 fflush (stdout); 47 fflush (stdout);
48} 48}
49 49
50
51#if !defined(GNUNET_CULL_LOGGING)
50static int 52static int
51expensive_func () 53expensive_func ()
52{ 54{
53 return GNUNET_NETWORK_socket_select (NULL, NULL, NULL, OUTPUT_DELAY); 55 return GNUNET_NETWORK_socket_select (NULL, NULL, NULL, OUTPUT_DELAY);
54} 56}
57#endif
58
55 59
56#define pr(kind,lvl) {\ 60#define pr(kind,lvl) {\
57 struct GNUNET_TIME_Absolute t1, t2;\ 61 struct GNUNET_TIME_Absolute t1, t2;\