Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5010f29
)
libcom_err: Use thread local storage to fix reentrancy problems
author
Theodore Ts'o
<tytso@mit.edu>
Sun, 10 Feb 2008 04:39:27 +0000
(23:39 -0500)
committer
Theodore Ts'o
<tytso@mit.edu>
Sun, 10 Feb 2008 04:49:19 +0000
(23:49 -0500)
Address the theoretical problem of two threads trying to format a
different unknown error code by using TLS.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/et/error_message.c
patch
|
blob
|
history
diff --git
a/lib/et/error_message.c
b/lib/et/error_message.c
index
708dd2f
..
2507fc0
100644
(file)
--- a/
lib/et/error_message.c
+++ b/
lib/et/error_message.c
@@
-38,7
+38,13
@@
#include "error_table.h"
#include "internal.h"
-static char buffer[25];
+#ifdef TLS
+#define THREAD_LOCAL static TLS
+#else
+#define THREAD_LOCAL static
+#endif
+
+THREAD_LOCAL char buffer[25];
struct et_list * _et_list = (struct et_list *) NULL;
struct et_list * _et_dynamic_list = (struct et_list *) NULL;