This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix regex locking.


libc-alpha,

The lock should be initialized after init_dfa, since this function
memset's the entire dfa structure to zero including the lock.
This fixes 2 regex regressions on hppa.

Jakub, did you want to just have __libc_lock_init as part of init_dfa?

c.

2005-06-27  Carlos O'Donell <carlos@systemhalted.org>

	* posix/regcomp.c (re_compile_internal): __libc_lock_init
	after init_dfa.

Index: posix/regcomp.c
===================================================================
RCS file: /cvs/glibc/libc/posix/regcomp.c,v
retrieving revision 1.95
diff -u -p -r1.95 regcomp.c
--- posix/regcomp.c	6 May 2005 23:33:52 -0000	1.95
+++ posix/regcomp.c	26 Jun 2005 23:37:00 -0000
@@ -774,9 +774,9 @@ re_compile_internal (preg, pattern, leng
     }
   preg->used = sizeof (re_dfa_t);
 
-  __libc_lock_init (dfa->lock);
-
   err = init_dfa (dfa, length);
+  __libc_lock_init (dfa->lock);
+  
   if (BE (err != REG_NOERROR, 0))
     {
       free_dfa_content (dfa);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]