Przeglądaj źródła

Fix using RTLD_DEFAULT

Samuel Thibault 4 lat temu
rodzic
commit
ba5247994a

+ 2 - 2
src/drivers/mic/driver_mic_sink.c

@@ -224,9 +224,9 @@ void _starpu_mic_sink_bind_thread(const struct _starpu_mp_node *mp_node STARPU_A
 void (*_starpu_mic_sink_lookup (const struct _starpu_mp_node * node STARPU_ATTRIBUTE_UNUSED, char* func_name))(void)
 void (*_starpu_mic_sink_lookup (const struct _starpu_mp_node * node STARPU_ATTRIBUTE_UNUSED, char* func_name))(void)
 {
 {
 #ifdef RTLD_DEFAULT
 #ifdef RTLD_DEFAULT
-	void *dl_handle = dlopen(RTLD_DEFAULT, RTLD_NOW);
+	return dlsym(RTLD_DEFAULT, func_name);
 #else
 #else
 	void *dl_handle = dlopen(NULL, RTLD_NOW);
 	void *dl_handle = dlopen(NULL, RTLD_NOW);
-#endif
 	return dlsym(dl_handle, func_name);
 	return dlsym(dl_handle, func_name);
+#endif
 }
 }

+ 2 - 2
src/drivers/mpi/driver_mpi_sink.c

@@ -45,11 +45,11 @@ void _starpu_mpi_sink_deinit(struct _starpu_mp_node *node)
 void (*_starpu_mpi_sink_lookup (const struct _starpu_mp_node * node STARPU_ATTRIBUTE_UNUSED, char* func_name))(void)
 void (*_starpu_mpi_sink_lookup (const struct _starpu_mp_node * node STARPU_ATTRIBUTE_UNUSED, char* func_name))(void)
 {
 {
 #ifdef RTLD_DEFAULT
 #ifdef RTLD_DEFAULT
-        void *dl_handle = dlopen(RTLD_DEFAULT, RTLD_NOW);
+        return dlsym(RTLD_DEFAULT, func_name);
 #else
 #else
         void *dl_handle = dlopen(NULL, RTLD_NOW);
         void *dl_handle = dlopen(NULL, RTLD_NOW);
-#endif
         return dlsym(dl_handle, func_name);
         return dlsym(dl_handle, func_name);
+#endif
 }
 }
 
 
 void _starpu_mpi_sink_launch_workers(struct _starpu_mp_node *node)
 void _starpu_mpi_sink_launch_workers(struct _starpu_mp_node *node)