changeset 17704:208ef1a25d09

regex: don't be multithreaded if USE_UNLOCKED_IO. Problem reported by Michael Felt in: http://bugs.gnu.org/17773 * lib/regex_internal.h: Do not use multithreaded version if USE_UNLOCKED_IO is defined. This is a hack, but it works around a porting bug with coreutils 8.22 on AIX 7.1.
author Paul Eggert <eggert@cs.ucla.edu>
date Fri, 13 Jun 2014 08:30:48 -0700
parents ba9e9026f860
children cc3765e7c7ab
files ChangeLog lib/regex_internal.h
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-06-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+	regex: don't be multithreaded if USE_UNLOCKED_IO.
+	Problem reported by Michael Felt in: http://bugs.gnu.org/17773
+	* lib/regex_internal.h: Do not use multithreaded version if
+	USE_UNLOCKED_IO is defined.  This is a hack, but it works
+	around a porting bug with coreutils 8.22 on AIX 7.1.
+
 2014-06-11  Daiki Ueno  <ueno@gnu.org>
 
 	gettext: update macros to version 0.19
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -40,7 +40,7 @@
 # define lock_fini(lock) 0
 # define lock_lock(lock) __libc_lock_lock (lock)
 # define lock_unlock(lock) __libc_lock_unlock (lock)
-#elif defined GNULIB_LOCK
+#elif defined GNULIB_LOCK && !defined USE_UNLOCKED_IO
 # include "glthread/lock.h"
   /* Use gl_lock_define if empty macro arguments are known to work.
      Otherwise, fall back on less-portable substitutes.  */
@@ -62,7 +62,7 @@
 # define lock_fini(lock) glthread_lock_destroy (&(lock))
 # define lock_lock(lock) glthread_lock_lock (&(lock))
 # define lock_unlock(lock) glthread_lock_unlock (&(lock))
-#elif defined GNULIB_PTHREAD
+#elif defined GNULIB_PTHREAD && !defined USE_UNLOCKED_IO
 # include <pthread.h>
 # define lock_define(name) pthread_mutex_t name;
 # define lock_init(lock) pthread_mutex_init (&(lock), 0)