[multipathd] Fix pthread bug in multipath-tools.
authorAlex Zeffertt <alex.zeffertt@eu.citrix.com>
Wed, 3 Feb 2010 12:29:37 +0000 (13:29 +0100)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Wed, 3 Feb 2010 12:29:37 +0000 (13:29 +0100)
You should lock the mutex before doing a pthread_cond_wait otherwise
undefined results occur.  In fact we get away with this with glibc,
but with uclibc it causes a segfault.

multipathd/main.c

index 73b06cb..e875d14 100644 (file)
@@ -1441,6 +1441,7 @@ child (void * param)
        pthread_create(&uxlsnr_thr, &misc_attr, uxlsnrloop, vecs);
        pthread_attr_destroy(&misc_attr);
 
+       lock(&exit_mutex);
        pthread_cond_wait(&exit_cond, &exit_mutex);
 
        /*