diff mbox

multipathd pthread locking fix

Message ID 4B69606D.2090206@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Zeffertt Feb. 3, 2010, 11:39 a.m. UTC
None
diff mbox

Patch

Fix pthread bug in multipath-tools.

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.


Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>

--- ./multipathd/main.c.orig	2010-02-03 05:42:14.000000000 -0500
+++ ./multipathd/main.c	2010-02-03 05:43:13.000000000 -0500
@@ -1668,6 +1668,7 @@ 
 	/*pthread_create(&uevent_thr, &attr, ueventloop, vecs);*/
 	pthread_create(&uxlsnr_thr, &attr, uxlsnrloop, vecs);
 
+	lock(&exit_mutex);
 	pthread_cond_wait(&exit_cond, &exit_mutex);
 
 	/*