Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 83

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

autofs-5.0.1 - fix pthread push order in expire_proc_direct()

From: Ian Kent <raven@themaw.net>

Apparently the pthread_cleanup_push() has the quite stupid semantic
of not working properly if the value of the pointer passed to it
changes after it has been called.
---

 daemon/direct.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


--- autofs-5.0.1.orig/daemon/direct.c
+++ autofs-5.0.1/daemon/direct.c
@@ -829,8 +829,8 @@ void *expire_proc_direct(void *arg)
 
 	left = 0;
 
-	pthread_cleanup_push(mnts_cleanup, mnts);
 	mnts = tree_make_mnt_tree(_PROC_MOUNTS, "/");
+	pthread_cleanup_push(mnts_cleanup, mnts);
 
 	/* Get a list of mounts select real ones and expire them if possible */
 	INIT_LIST_HEAD(&list);