소스 검색

Fix using RTLD_DEFAULT

Samuel Thibault 4 년 전
부모
커밋
ba5247994a
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 2
      src/drivers/mic/driver_mic_sink.c
  2. 2 2
      src/drivers/mpi/driver_mpi_sink.c

+ 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)
 {
 #ifdef RTLD_DEFAULT
-	void *dl_handle = dlopen(RTLD_DEFAULT, RTLD_NOW);
+	return dlsym(RTLD_DEFAULT, func_name);
 #else
 	void *dl_handle = dlopen(NULL, RTLD_NOW);
-#endif
 	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)
 {
 #ifdef RTLD_DEFAULT
-        void *dl_handle = dlopen(RTLD_DEFAULT, RTLD_NOW);
+        return dlsym(RTLD_DEFAULT, func_name);
 #else
         void *dl_handle = dlopen(NULL, RTLD_NOW);
-#endif
         return dlsym(dl_handle, func_name);
+#endif
 }
 
 void _starpu_mpi_sink_launch_workers(struct _starpu_mp_node *node)