don't bail out when pthread_once's init route calls itself recursively


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1684 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c
index c04f15c..8e4cb36 100644
--- a/coregrind/arch/x86-linux/vg_libpthread.c
+++ b/coregrind/arch/x86-linux/vg_libpthread.c
@@ -1500,10 +1500,9 @@
 
    res = __pthread_mutex_lock(&once_masterlock);
 
-   if (res != 0) {
-      barf("pthread_once: Looks like your program's "
-           "init routine calls back to pthread_once() ?!");
-   }
+   /* init routine called us again ? */
+   if (res != 0)
+       return 0;
 
    if (*once_control == 0) {
       *once_control = 1;
diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c
index c04f15c..8e4cb36 100644
--- a/coregrind/vg_libpthread.c
+++ b/coregrind/vg_libpthread.c
@@ -1500,10 +1500,9 @@
 
    res = __pthread_mutex_lock(&once_masterlock);
 
-   if (res != 0) {
-      barf("pthread_once: Looks like your program's "
-           "init routine calls back to pthread_once() ?!");
-   }
+   /* init routine called us again ? */
+   if (res != 0)
+       return 0;
 
    if (*once_control == 0) {
       *once_control = 1;