Răsfoiți Sursa

Handle LCR problem with unloading "unneeded" components

In LCR, global variable g_component_handle is used to keep handle of loaded
component. If this variable has magic value (0xFFFFFFFF) it means, 
"we loaded library, but that library doesn't have any component_register 
call -> don't try to destroy interfaces list).

If this variable has other value, it means "we loaded library, it registers,
but it exports some interface, what we currently don't need, so we can delete
that handle from libraries/interfaces list" and variable is set to magic value,
or "we loaded library, it registers and exports what we need -> great return some
nice value", but nobody resets variable to it's magic value.

Sadly, if you have loaded some component (needed), then try to load component,
which don't have component_register function, previously loaded component handle
is destroyed. 

This problem happened to clm and quorum services, and cause, that loaded
clm handle was destroyed, so EVT (which need clm) just falls.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2234 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jan Friesse 16 ani în urmă
părinte
comite
8b9812de8f
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 2 0
      lcr/lcr_ifact.c

+ 2 - 0
lcr/lcr_ifact.c

@@ -426,6 +426,7 @@ static int interface_find_and_load (
 		}
 		}
 		free (scandir_list);
 		free (scandir_list);
 	}
 	}
+	g_component_handle = 0xFFFFFFFF;
 	return -1;
 	return -1;
 
 
 found:
 found:
@@ -437,6 +438,7 @@ found:
 		}
 		}
 		free (scandir_list);
 		free (scandir_list);
 	}
 	}
+	g_component_handle = 0xFFFFFFFF;
 	return 0;
 	return 0;
 }
 }