diff options
-rw-r--r-- | src/include/platform.h | 2 | ||||
-rw-r--r-- | src/include/winproc.h | 3 | ||||
-rw-r--r-- | src/util/common_logging.c | 21 |
3 files changed, 18 insertions, 8 deletions
diff --git a/src/include/platform.h b/src/include/platform.h index 07fbe0ee7..a649d3aa5 100644 --- a/src/include/platform.h +++ b/src/include/platform.h | |||
@@ -160,7 +160,9 @@ | |||
160 | 160 | ||
161 | #include "plibc.h" | 161 | #include "plibc.h" |
162 | 162 | ||
163 | #undef HAVE_CONFIG_H | ||
163 | #include <pthread.h> | 164 | #include <pthread.h> |
165 | #define HAVE_CONFIG_H 1 | ||
164 | #include <locale.h> | 166 | #include <locale.h> |
165 | #ifndef FRAMEWORK_BUILD | 167 | #ifndef FRAMEWORK_BUILD |
166 | #include "gettext.h" | 168 | #include "gettext.h" |
diff --git a/src/include/winproc.h b/src/include/winproc.h index a4a173a13..9619f60d9 100644 --- a/src/include/winproc.h +++ b/src/include/winproc.h | |||
@@ -44,8 +44,7 @@ | |||
44 | #include <Ntsecapi.h> | 44 | #include <Ntsecapi.h> |
45 | #include <lm.h> | 45 | #include <lm.h> |
46 | #include <Aclapi.h> | 46 | #include <Aclapi.h> |
47 | #include "gnunet_util.h" | 47 | |
48 | #include "platform.h" | ||
49 | 48 | ||
50 | #ifdef __cplusplus | 49 | #ifdef __cplusplus |
51 | extern "C" | 50 | extern "C" |
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 4068ed94b..2fdd17ca7 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -123,6 +123,8 @@ static struct CustomLogger *loggers; | |||
123 | */ | 123 | */ |
124 | static unsigned int skip_log; | 124 | static unsigned int skip_log; |
125 | 125 | ||
126 | static FILE *GNUNET_stderr; | ||
127 | |||
126 | /** | 128 | /** |
127 | * Convert a textual description of a loglevel | 129 | * Convert a textual description of a loglevel |
128 | * to the respective GNUNET_GE_KIND. | 130 | * to the respective GNUNET_GE_KIND. |
@@ -163,9 +165,9 @@ GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile) | |||
163 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", logfile); | 165 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", logfile); |
164 | return GNUNET_SYSERR; | 166 | return GNUNET_SYSERR; |
165 | } | 167 | } |
166 | if (stderr != NULL) | 168 | if (GNUNET_stderr != NULL) |
167 | fclose (stderr); | 169 | fclose (GNUNET_stderr); |
168 | stderr = altlog; | 170 | GNUNET_stderr = altlog; |
169 | return GNUNET_OK; | 171 | return GNUNET_OK; |
170 | } | 172 | } |
171 | 173 | ||
@@ -220,8 +222,8 @@ output_message (enum GNUNET_ErrorType kind, | |||
220 | const char *comp, const char *datestr, const char *msg) | 222 | const char *comp, const char *datestr, const char *msg) |
221 | { | 223 | { |
222 | struct CustomLogger *pos; | 224 | struct CustomLogger *pos; |
223 | if (stderr != NULL) | 225 | if (GNUNET_stderr != NULL) |
224 | fprintf (stderr, "%s %s %s %s", datestr, comp, | 226 | fprintf (GNUNET_stderr, "%s %s %s %s", datestr, comp, |
225 | GNUNET_error_type_to_string (kind), msg); | 227 | GNUNET_error_type_to_string (kind), msg); |
226 | pos = loggers; | 228 | pos = loggers; |
227 | while (pos != NULL) | 229 | while (pos != NULL) |
@@ -396,6 +398,13 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid) | |||
396 | return (const char *) ret.encoding; | 398 | return (const char *) ret.encoding; |
397 | } | 399 | } |
398 | 400 | ||
399 | 401 | /** | |
402 | * Initializer | ||
403 | */ | ||
404 | void __attribute__ ((constructor)) | ||
405 | GNUNET_util_cl_init() | ||
406 | { | ||
407 | GNUNET_stderr = stderr; | ||
408 | } | ||
400 | 409 | ||
401 | /* end of common_logging.c */ | 410 | /* end of common_logging.c */ |