This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] Fix regex locking.
- From: Carlos O'Donell <carlos at systemhalted dot org>
- To: libc-alpha <libc-alpha at sources dot redhat dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 27 Jun 2005 23:19:31 -0400
- Subject: [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);