diff options
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r-- | src/util/common_logging.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 19bbbdb81..d3666ae7d 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -107,8 +107,7 @@ static __thread struct GNUNET_AsyncScopeSave current_async_scope; | |||
107 | * Note that this message maybe truncated to the first BULK_TRACK_SIZE | 107 | * Note that this message maybe truncated to the first BULK_TRACK_SIZE |
108 | * characters, in which case it is NOT 0-terminated! | 108 | * characters, in which case it is NOT 0-terminated! |
109 | */ | 109 | */ |
110 | static GNUNET_THREAD_LOCAL char last_bulk[BULK_TRACK_SIZE] | 110 | static GNUNET_THREAD_LOCAL char last_bulk[BULK_TRACK_SIZE] __nonstring; |
111 | __nonstring; | ||
112 | 111 | ||
113 | /** | 112 | /** |
114 | * Type of the last bulk message. | 113 | * Type of the last bulk message. |
@@ -325,7 +324,7 @@ log_rotate (const char *new_name) | |||
325 | { | 324 | { |
326 | /* Note: can't log errors during logging (recursion!), so this | 325 | /* Note: can't log errors during logging (recursion!), so this |
327 | operation MUST silently fail... */ | 326 | operation MUST silently fail... */ |
328 | (void) UNLINK (discard); | 327 | (void) unlink (discard); |
329 | GNUNET_free (discard); | 328 | GNUNET_free (discard); |
330 | } | 329 | } |
331 | rotation[rotation_off % ROTATION_KEEP] = GNUNET_strdup (new_name); | 330 | rotation[rotation_off % ROTATION_KEEP] = GNUNET_strdup (new_name); |
@@ -377,14 +376,14 @@ setup_log_file (const struct tm *tm) | |||
377 | fprintf (stderr, | 376 | fprintf (stderr, |
378 | "Failed to create directory for `%s': %s\n", | 377 | "Failed to create directory for `%s': %s\n", |
379 | fn, | 378 | fn, |
380 | STRERROR (errno)); | 379 | strerror (errno)); |
381 | return GNUNET_SYSERR; | 380 | return GNUNET_SYSERR; |
382 | } | 381 | } |
383 | #if WINDOWS | 382 | #if WINDOWS |
384 | altlog_fd = | 383 | altlog_fd = |
385 | OPEN (fn, O_APPEND | O_BINARY | O_WRONLY | O_CREAT, _S_IREAD | _S_IWRITE); | 384 | open (fn, O_APPEND | O_BINARY | O_WRONLY | O_CREAT, _S_IREAD | _S_IWRITE); |
386 | #else | 385 | #else |
387 | altlog_fd = OPEN (fn, | 386 | altlog_fd = open (fn, |
388 | O_APPEND | O_WRONLY | O_CREAT, | 387 | O_APPEND | O_WRONLY | O_CREAT, |
389 | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); | 388 | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); |
390 | #endif | 389 | #endif |
@@ -841,7 +840,7 @@ output_message (enum GNUNET_ErrorType kind, | |||
841 | * this way if the output is going to logfiles or robots | 840 | * this way if the output is going to logfiles or robots |
842 | * instead. | 841 | * instead. |
843 | */ | 842 | */ |
844 | FPRINTF (GNUNET_stderr, "* %s", msg); | 843 | fprintf (GNUNET_stderr, "* %s", msg); |
845 | } | 844 | } |
846 | else if (GNUNET_YES == current_async_scope.have_scope) | 845 | else if (GNUNET_YES == current_async_scope.have_scope) |
847 | { | 846 | { |
@@ -857,7 +856,7 @@ output_message (enum GNUNET_ErrorType kind, | |||
857 | GNUNET_assert (NULL != end); | 856 | GNUNET_assert (NULL != end); |
858 | *end = '\0'; | 857 | *end = '\0'; |
859 | skip_log = 0; | 858 | skip_log = 0; |
860 | FPRINTF (GNUNET_stderr, | 859 | fprintf (GNUNET_stderr, |
861 | "%s %s(%s) %s %s", | 860 | "%s %s(%s) %s %s", |
862 | datestr, | 861 | datestr, |
863 | comp, | 862 | comp, |
@@ -867,7 +866,7 @@ output_message (enum GNUNET_ErrorType kind, | |||
867 | } | 866 | } |
868 | else | 867 | else |
869 | { | 868 | { |
870 | FPRINTF (GNUNET_stderr, | 869 | fprintf (GNUNET_stderr, |
871 | "%s %s %s %s", | 870 | "%s %s %s %s", |
872 | datestr, | 871 | datestr, |
873 | comp, | 872 | comp, |
@@ -991,7 +990,7 @@ mylog (enum GNUNET_ErrorType kind, | |||
991 | va_list vacp; | 990 | va_list vacp; |
992 | 991 | ||
993 | va_copy (vacp, va); | 992 | va_copy (vacp, va); |
994 | size = VSNPRINTF (NULL, 0, message, vacp) + 1; | 993 | size = vsnprintf (NULL, 0, message, vacp) + 1; |
995 | GNUNET_assert (0 != size); | 994 | GNUNET_assert (0 != size); |
996 | va_end (vacp); | 995 | va_end (vacp); |
997 | memset (date, 0, DATE_STR_SIZE); | 996 | memset (date, 0, DATE_STR_SIZE); |
@@ -1065,7 +1064,7 @@ mylog (enum GNUNET_ErrorType kind, | |||
1065 | abort (); | 1064 | abort (); |
1066 | } | 1065 | } |
1067 | #endif | 1066 | #endif |
1068 | VSNPRINTF (buf, size, message, va); | 1067 | vsnprintf (buf, size, message, va); |
1069 | #if ! (defined(GNUNET_CULL_LOGGING) || TALER_WALLET_ONLY) | 1068 | #if ! (defined(GNUNET_CULL_LOGGING) || TALER_WALLET_ONLY) |
1070 | if (NULL != tmptr) | 1069 | if (NULL != tmptr) |
1071 | (void) setup_log_file (tmptr); | 1070 | (void) setup_log_file (tmptr); |