| 2127 | } |
| 2128 | |
| 2129 | void * |
| 2130 | find_library_function(void **handle, const char *lib, const char *fn, gboolean fatal) |
| 2131 | { |
| 2132 | char *error; |
| 2133 | void *a_function; |
| 2134 | |
| 2135 | if (*handle == NULL) { |
| 2136 | *handle = dlopen(lib, RTLD_LAZY); |
| 2137 | } |
| 2138 | |
| 2139 | if (!(*handle)) { |
| 2140 | crm_err("%sCould not open %s: %s", fatal?"Fatal: ":"", lib, dlerror()); |
| 2141 | if(fatal) { |
| 2142 | crm_exit(100); |
| 2143 | } |
| 2144 | return NULL; |
| 2145 | } |
| 2146 | |
| 2147 | a_function = dlsym(*handle, fn); |
| 2148 | if ((error = dlerror()) != NULL) { |
| 2149 | crm_err("%sCould not find %s in %s: %s", fatal?"Fatal: ":"", fn, lib, error); |
| 2150 | if(fatal) { |
| 2151 | crm_exit(100); |
| 2152 | } |
| 2153 | } |
| 2154 | |
| 2155 | return a_function; |
| 2156 | } |
| 2157 | |
| 2158 | char * |
| 2159 | add_list_element(char *list, const char *value) |
no test coverage detected