git » libfiu » commit a9ffe90

libfiu: Put a global static variable inside the only function that uses it

author Alberto Bertogli
2009-07-02 22:48:28 UTC
committer Alberto Bertogli
2009-07-02 22:48:28 UTC
parent 3f5fed858a7542035c5b9eb9eaf93edb7b7a5ec2

libfiu: Put a global static variable inside the only function that uses it

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libfiu/fiu.c +3 -3

diff --git a/libfiu/fiu.c b/libfiu/fiu.c
index f0c344b..5c3218d 100644
--- a/libfiu/fiu.c
+++ b/libfiu/fiu.c
@@ -88,9 +88,6 @@ __thread int rec_count = 0;
 /* Used to keep the last failinfo via TLS */
 static pthread_key_t last_failinfo_key;
 
-/* Used to avoid re-initialization, protected by enabled_fails_lock */
-static int initialized = 0;
-
 
 /*
  * Miscelaneous internal functions
@@ -219,6 +216,9 @@ static void atfork_child(void)
  * time without clashes. */
 int fiu_init(unsigned int flags)
 {
+	/* Used to avoid re-initialization, protected by enabled_fails_lock */
+	static int initialized = 0;
+
 	rec_count++;
 	ef_wlock();
 	if (initialized) {