diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-02 11:33:53 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-02 11:33:53 +0200 |
commit | 225ddf0a2f704547e49ac3c3878b9015c915a02a (patch) | |
tree | af04acdb51b6cd54cba479ee3650c246f50a1280 /src | |
parent | a4653a7a0f5f3c5e2374aa4dc104208b5f758793 (diff) | |
download | gnunet-225ddf0a2f704547e49ac3c3878b9015c915a02a.tar.gz gnunet-225ddf0a2f704547e49ac3c3878b9015c915a02a.zip |
fix #6146
Diffstat (limited to 'src')
-rw-r--r-- | src/util/common_logging.c | 24 | ||||
-rw-r--r-- | src/util/strings.c | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 527dffc02..3894cdda1 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -100,7 +100,7 @@ struct CustomLogger | |||
100 | * Asynchronous scope of the current thread, or NULL if we have not | 100 | * Asynchronous scope of the current thread, or NULL if we have not |
101 | * entered an async scope yet. | 101 | * entered an async scope yet. |
102 | */ | 102 | */ |
103 | static __thread struct GNUNET_AsyncScopeSave current_async_scope; | 103 | static GNUNET_THREAD_LOCAL struct GNUNET_AsyncScopeSave current_async_scope; |
104 | 104 | ||
105 | /** | 105 | /** |
106 | * The last "bulk" error message that we have been logging. | 106 | * The last "bulk" error message that we have been logging. |
@@ -287,7 +287,7 @@ GNUNET_abort_ () | |||
287 | * Utility function - reallocates logdefs array to be twice as large. | 287 | * Utility function - reallocates logdefs array to be twice as large. |
288 | */ | 288 | */ |
289 | static void | 289 | static void |
290 | resize_logdefs () | 290 | resize_logdefs (void) |
291 | { | 291 | { |
292 | logdefs_size = (logdefs_size + 1) * 2; | 292 | logdefs_size = (logdefs_size + 1) * 2; |
293 | logdefs = GNUNET_realloc (logdefs, logdefs_size * sizeof(struct LogDef)); | 293 | logdefs = GNUNET_realloc (logdefs, logdefs_size * sizeof(struct LogDef)); |
@@ -1148,7 +1148,7 @@ GNUNET_h2s (const struct GNUNET_HashCode *hc) | |||
1148 | const char * | 1148 | const char * |
1149 | GNUNET_h2s2 (const struct GNUNET_HashCode *hc) | 1149 | GNUNET_h2s2 (const struct GNUNET_HashCode *hc) |
1150 | { | 1150 | { |
1151 | static struct GNUNET_CRYPTO_HashAsciiEncoded ret; | 1151 | static GNUNET_THREAD_LOCAL struct GNUNET_CRYPTO_HashAsciiEncoded ret; |
1152 | 1152 | ||
1153 | GNUNET_CRYPTO_hash_to_enc (hc, &ret); | 1153 | GNUNET_CRYPTO_hash_to_enc (hc, &ret); |
1154 | ret.encoding[8] = '\0'; | 1154 | ret.encoding[8] = '\0'; |
@@ -1168,7 +1168,7 @@ GNUNET_h2s2 (const struct GNUNET_HashCode *hc) | |||
1168 | const char * | 1168 | const char * |
1169 | GNUNET_p2s (const struct GNUNET_CRYPTO_EddsaPublicKey *p) | 1169 | GNUNET_p2s (const struct GNUNET_CRYPTO_EddsaPublicKey *p) |
1170 | { | 1170 | { |
1171 | static struct GNUNET_CRYPTO_HashAsciiEncoded ret; | 1171 | static GNUNET_THREAD_LOCAL struct GNUNET_CRYPTO_HashAsciiEncoded ret; |
1172 | struct GNUNET_HashCode hc; | 1172 | struct GNUNET_HashCode hc; |
1173 | 1173 | ||
1174 | GNUNET_CRYPTO_hash (p, sizeof(*p), &hc); | 1174 | GNUNET_CRYPTO_hash (p, sizeof(*p), &hc); |
@@ -1190,7 +1190,7 @@ GNUNET_p2s (const struct GNUNET_CRYPTO_EddsaPublicKey *p) | |||
1190 | const char * | 1190 | const char * |
1191 | GNUNET_p2s2 (const struct GNUNET_CRYPTO_EddsaPublicKey *p) | 1191 | GNUNET_p2s2 (const struct GNUNET_CRYPTO_EddsaPublicKey *p) |
1192 | { | 1192 | { |
1193 | static struct GNUNET_CRYPTO_HashAsciiEncoded ret; | 1193 | static GNUNET_THREAD_LOCAL struct GNUNET_CRYPTO_HashAsciiEncoded ret; |
1194 | struct GNUNET_HashCode hc; | 1194 | struct GNUNET_HashCode hc; |
1195 | 1195 | ||
1196 | GNUNET_CRYPTO_hash (p, sizeof(*p), &hc); | 1196 | GNUNET_CRYPTO_hash (p, sizeof(*p), &hc); |
@@ -1212,7 +1212,7 @@ GNUNET_p2s2 (const struct GNUNET_CRYPTO_EddsaPublicKey *p) | |||
1212 | const char * | 1212 | const char * |
1213 | GNUNET_e2s (const struct GNUNET_CRYPTO_EcdhePublicKey *p) | 1213 | GNUNET_e2s (const struct GNUNET_CRYPTO_EcdhePublicKey *p) |
1214 | { | 1214 | { |
1215 | static struct GNUNET_CRYPTO_HashAsciiEncoded ret; | 1215 | static GNUNET_THREAD_LOCAL struct GNUNET_CRYPTO_HashAsciiEncoded ret; |
1216 | struct GNUNET_HashCode hc; | 1216 | struct GNUNET_HashCode hc; |
1217 | 1217 | ||
1218 | GNUNET_CRYPTO_hash (p, sizeof(*p), &hc); | 1218 | GNUNET_CRYPTO_hash (p, sizeof(*p), &hc); |
@@ -1234,7 +1234,7 @@ GNUNET_e2s (const struct GNUNET_CRYPTO_EcdhePublicKey *p) | |||
1234 | const char * | 1234 | const char * |
1235 | GNUNET_e2s2 (const struct GNUNET_CRYPTO_EcdhePublicKey *p) | 1235 | GNUNET_e2s2 (const struct GNUNET_CRYPTO_EcdhePublicKey *p) |
1236 | { | 1236 | { |
1237 | static struct GNUNET_CRYPTO_HashAsciiEncoded ret; | 1237 | static GNUNET_THREAD_LOCAL struct GNUNET_CRYPTO_HashAsciiEncoded ret; |
1238 | struct GNUNET_HashCode hc; | 1238 | struct GNUNET_HashCode hc; |
1239 | 1239 | ||
1240 | GNUNET_CRYPTO_hash (p, sizeof(*p), &hc); | 1240 | GNUNET_CRYPTO_hash (p, sizeof(*p), &hc); |
@@ -1256,7 +1256,7 @@ GNUNET_e2s2 (const struct GNUNET_CRYPTO_EcdhePublicKey *p) | |||
1256 | const char * | 1256 | const char * |
1257 | GNUNET_sh2s (const struct GNUNET_ShortHashCode *shc) | 1257 | GNUNET_sh2s (const struct GNUNET_ShortHashCode *shc) |
1258 | { | 1258 | { |
1259 | static char buf[64]; | 1259 | static GNUNET_THREAD_LOCAL char buf[64]; |
1260 | 1260 | ||
1261 | GNUNET_STRINGS_data_to_string (shc, sizeof(*shc), buf, sizeof(buf)); | 1261 | GNUNET_STRINGS_data_to_string (shc, sizeof(*shc), buf, sizeof(buf)); |
1262 | buf[6] = '\0'; | 1262 | buf[6] = '\0'; |
@@ -1276,7 +1276,7 @@ GNUNET_sh2s (const struct GNUNET_ShortHashCode *shc) | |||
1276 | const char * | 1276 | const char * |
1277 | GNUNET_uuid2s (const struct GNUNET_Uuid *uuid) | 1277 | GNUNET_uuid2s (const struct GNUNET_Uuid *uuid) |
1278 | { | 1278 | { |
1279 | static char buf[32]; | 1279 | static GNUNET_THREAD_LOCAL char buf[32]; |
1280 | 1280 | ||
1281 | GNUNET_STRINGS_data_to_string (uuid, sizeof(*uuid), buf, sizeof(buf)); | 1281 | GNUNET_STRINGS_data_to_string (uuid, sizeof(*uuid), buf, sizeof(buf)); |
1282 | buf[6] = '\0'; | 1282 | buf[6] = '\0'; |
@@ -1295,7 +1295,7 @@ GNUNET_uuid2s (const struct GNUNET_Uuid *uuid) | |||
1295 | const char * | 1295 | const char * |
1296 | GNUNET_h2s_full (const struct GNUNET_HashCode *hc) | 1296 | GNUNET_h2s_full (const struct GNUNET_HashCode *hc) |
1297 | { | 1297 | { |
1298 | static struct GNUNET_CRYPTO_HashAsciiEncoded ret; | 1298 | static GNUNET_THREAD_LOCAL struct GNUNET_CRYPTO_HashAsciiEncoded ret; |
1299 | 1299 | ||
1300 | GNUNET_CRYPTO_hash_to_enc (hc, &ret); | 1300 | GNUNET_CRYPTO_hash_to_enc (hc, &ret); |
1301 | ret.encoding[sizeof(ret) - 1] = '\0'; | 1301 | ret.encoding[sizeof(ret) - 1] = '\0'; |
@@ -1386,9 +1386,9 @@ GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen) | |||
1386 | #define LEN \ | 1386 | #define LEN \ |
1387 | GNUNET_MAX ((INET6_ADDRSTRLEN + 8), \ | 1387 | GNUNET_MAX ((INET6_ADDRSTRLEN + 8), \ |
1388 | (1 + sizeof(struct sockaddr_un) - sizeof(sa_family_t))) | 1388 | (1 + sizeof(struct sockaddr_un) - sizeof(sa_family_t))) |
1389 | static char buf[LEN]; | 1389 | static GNUNET_THREAD_LOCAL char buf[LEN]; |
1390 | #undef LEN | 1390 | #undef LEN |
1391 | static char b2[6]; | 1391 | static GNUNET_THREAD_LOCAL char b2[6]; |
1392 | const struct sockaddr_in *v4; | 1392 | const struct sockaddr_in *v4; |
1393 | const struct sockaddr_un *un; | 1393 | const struct sockaddr_un *un; |
1394 | const struct sockaddr_in6 *v6; | 1394 | const struct sockaddr_in6 *v6; |
diff --git a/src/util/strings.c b/src/util/strings.c index ac9805cdd..f32c3ea61 100644 --- a/src/util/strings.c +++ b/src/util/strings.c | |||
@@ -690,7 +690,7 @@ const char * | |||
690 | GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative delta, | 690 | GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative delta, |
691 | int do_round) | 691 | int do_round) |
692 | { | 692 | { |
693 | static char buf[128]; | 693 | static GNUNET_THREAD_LOCAL char buf[128]; |
694 | const char *unit = _ (/* time unit */ "µs"); | 694 | const char *unit = _ (/* time unit */ "µs"); |
695 | uint64_t dval = delta.rel_value_us; | 695 | uint64_t dval = delta.rel_value_us; |
696 | 696 | ||
@@ -744,7 +744,7 @@ GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative delta, | |||
744 | const char * | 744 | const char * |
745 | GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t) | 745 | GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t) |
746 | { | 746 | { |
747 | static char buf[255]; | 747 | static GNUNET_THREAD_LOCAL char buf[255]; |
748 | time_t tt; | 748 | time_t tt; |
749 | struct tm *tp; | 749 | struct tm *tp; |
750 | 750 | ||