diff options
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r-- | src/util/common_logging.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 59a2eeb29..93a104c8d 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -294,7 +294,7 @@ GNUNET_abort () | |||
294 | * Rotate logs, deleting the oldest log. | 294 | * Rotate logs, deleting the oldest log. |
295 | * | 295 | * |
296 | * @param new_name new name to add to the rotation | 296 | * @param new_name new name to add to the rotation |
297 | */ | 297 | */ |
298 | static void | 298 | static void |
299 | log_rotate (const char *new_name) | 299 | log_rotate (const char *new_name) |
300 | { | 300 | { |
@@ -313,7 +313,7 @@ log_rotate (const char *new_name) | |||
313 | GNUNET_free (discard); | 313 | GNUNET_free (discard); |
314 | } | 314 | } |
315 | rotation[rotation_off % ROTATION_KEEP] = GNUNET_strdup (new_name); | 315 | rotation[rotation_off % ROTATION_KEEP] = GNUNET_strdup (new_name); |
316 | rotation_off++; | 316 | rotation_off++; |
317 | } | 317 | } |
318 | 318 | ||
319 | 319 | ||
@@ -326,14 +326,14 @@ log_rotate (const char *new_name) | |||
326 | static int | 326 | static int |
327 | setup_log_file (const struct tm *tm) | 327 | setup_log_file (const struct tm *tm) |
328 | { | 328 | { |
329 | static char last_fn[PATH_MAX + 1]; | 329 | static char last_fn[PATH_MAX + 1]; |
330 | char fn[PATH_MAX + 1]; | 330 | char fn[PATH_MAX + 1]; |
331 | int dirwarn; | 331 | int dirwarn; |
332 | int altlog_fd; | 332 | int altlog_fd; |
333 | int dup_return; | 333 | int dup_return; |
334 | FILE *altlog; | 334 | FILE *altlog; |
335 | char *leftsquare; | 335 | char *leftsquare; |
336 | 336 | ||
337 | if (NULL == log_file_name) | 337 | if (NULL == log_file_name) |
338 | return GNUNET_SYSERR; | 338 | return GNUNET_SYSERR; |
339 | if (0 == strftime (fn, sizeof (fn), log_file_name, tm)) | 339 | if (0 == strftime (fn, sizeof (fn), log_file_name, tm)) |
@@ -392,7 +392,7 @@ setup_log_file (const struct tm *tm) | |||
392 | fn); | 392 | fn); |
393 | return GNUNET_SYSERR; | 393 | return GNUNET_SYSERR; |
394 | } | 394 | } |
395 | GNUNET_stderr = altlog; | 395 | GNUNET_stderr = altlog; |
396 | return GNUNET_OK; | 396 | return GNUNET_OK; |
397 | } | 397 | } |
398 | 398 | ||
@@ -665,7 +665,7 @@ parse_all_definitions () | |||
665 | */ | 665 | */ |
666 | int | 666 | int |
667 | GNUNET_log_setup (const char *comp, | 667 | GNUNET_log_setup (const char *comp, |
668 | const char *loglevel, | 668 | const char *loglevel, |
669 | const char *logfile) | 669 | const char *logfile) |
670 | { | 670 | { |
671 | const char *env_logfile; | 671 | const char *env_logfile; |
@@ -831,7 +831,7 @@ flush_bulk (const char *datestr) | |||
831 | * @param check_reset #GNUNET_YES to assert that the log skip counter is currently zero | 831 | * @param check_reset #GNUNET_YES to assert that the log skip counter is currently zero |
832 | */ | 832 | */ |
833 | void | 833 | void |
834 | GNUNET_log_skip (int n, | 834 | GNUNET_log_skip (int n, |
835 | int check_reset) | 835 | int check_reset) |
836 | { | 836 | { |
837 | int ok; | 837 | int ok; |
@@ -872,7 +872,7 @@ GNUNET_get_log_skip () | |||
872 | */ | 872 | */ |
873 | static void | 873 | static void |
874 | mylog (enum GNUNET_ErrorType kind, | 874 | mylog (enum GNUNET_ErrorType kind, |
875 | const char *comp, | 875 | const char *comp, |
876 | const char *message, | 876 | const char *message, |
877 | va_list va) | 877 | va_list va) |
878 | { | 878 | { |
@@ -949,7 +949,7 @@ mylog (enum GNUNET_ErrorType kind, | |||
949 | strftime (date2, DATE_STR_SIZE, "%b %d %H:%M:%S-%%06u", tmptr); | 949 | strftime (date2, DATE_STR_SIZE, "%b %d %H:%M:%S-%%06u", tmptr); |
950 | snprintf (date, sizeof (date), date2, timeofday.tv_usec); | 950 | snprintf (date, sizeof (date), date2, timeofday.tv_usec); |
951 | } | 951 | } |
952 | #endif | 952 | #endif |
953 | VSNPRINTF (buf, size, message, va); | 953 | VSNPRINTF (buf, size, message, va); |
954 | if (NULL != tmptr) | 954 | if (NULL != tmptr) |
955 | (void) setup_log_file (tmptr); | 955 | (void) setup_log_file (tmptr); |
@@ -959,7 +959,7 @@ mylog (enum GNUNET_ErrorType kind, | |||
959 | { | 959 | { |
960 | last_bulk_repeat++; | 960 | last_bulk_repeat++; |
961 | if ( (GNUNET_TIME_absolute_get_duration (last_bulk_time).rel_value_us > | 961 | if ( (GNUNET_TIME_absolute_get_duration (last_bulk_time).rel_value_us > |
962 | BULK_DELAY_THRESHOLD) || | 962 | BULK_DELAY_THRESHOLD) || |
963 | (last_bulk_repeat > BULK_REPEAT_THRESHOLD) ) | 963 | (last_bulk_repeat > BULK_REPEAT_THRESHOLD) ) |
964 | flush_bulk (date); | 964 | flush_bulk (date); |
965 | return; | 965 | return; |
@@ -983,7 +983,7 @@ mylog (enum GNUNET_ErrorType kind, | |||
983 | * @param ... arguments for format string | 983 | * @param ... arguments for format string |
984 | */ | 984 | */ |
985 | void | 985 | void |
986 | GNUNET_log_nocheck (enum GNUNET_ErrorType kind, | 986 | GNUNET_log_nocheck (enum GNUNET_ErrorType kind, |
987 | const char *message, ...) | 987 | const char *message, ...) |
988 | { | 988 | { |
989 | va_list va; | 989 | va_list va; |
@@ -1199,7 +1199,7 @@ GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen) | |||
1199 | * @param option name of missing option | 1199 | * @param option name of missing option |
1200 | */ | 1200 | */ |
1201 | void | 1201 | void |
1202 | GNUNET_log_config_missing (enum GNUNET_ErrorType kind, | 1202 | GNUNET_log_config_missing (enum GNUNET_ErrorType kind, |
1203 | const char *section, | 1203 | const char *section, |
1204 | const char *option) | 1204 | const char *option) |
1205 | { | 1205 | { |
@@ -1219,7 +1219,7 @@ GNUNET_log_config_missing (enum GNUNET_ErrorType kind, | |||
1219 | * @param required what is required that is invalid about the option | 1219 | * @param required what is required that is invalid about the option |
1220 | */ | 1220 | */ |
1221 | void | 1221 | void |
1222 | GNUNET_log_config_invalid (enum GNUNET_ErrorType kind, | 1222 | GNUNET_log_config_invalid (enum GNUNET_ErrorType kind, |
1223 | const char *section, | 1223 | const char *section, |
1224 | const char *option, | 1224 | const char *option, |
1225 | const char *required) | 1225 | const char *required) |
@@ -1240,7 +1240,7 @@ void __attribute__ ((constructor)) GNUNET_util_cl_init () | |||
1240 | GNInitWinEnv (NULL); | 1240 | GNInitWinEnv (NULL); |
1241 | #endif | 1241 | #endif |
1242 | #if WINDOWS | 1242 | #if WINDOWS |
1243 | if (!InitializeCriticalSectionAndSpinCount (&output_message_cs, 0x00000400)) | 1243 | if (!InitializeCriticalSectionAndSpinCount (&output_message_cs, 0x00000400)) |
1244 | GNUNET_abort (); | 1244 | GNUNET_abort (); |
1245 | #endif | 1245 | #endif |
1246 | } | 1246 | } |