diff --git a/launcher/src/bootstrap.c b/launcher/src/bootstrap.c index 8a0cba3..813c5ae 100644 --- a/launcher/src/bootstrap.c +++ b/launcher/src/bootstrap.c @@ -130,7 +130,6 @@ void bootstrap(int argc, char *argv[]) { // Get Binary Directory char *binary_directory = get_binary_directory(); - setenv("MCPI_ROOT_PATH", binary_directory, 1); // Configure LD_LIBRARY_PATH { diff --git a/libreborn/CMakeLists.txt b/libreborn/CMakeLists.txt index da08f68..3a2bbcd 100644 --- a/libreborn/CMakeLists.txt +++ b/libreborn/CMakeLists.txt @@ -4,7 +4,7 @@ add_library(reborn-headers INTERFACE) target_include_directories(reborn-headers INTERFACE include) if(BUILD_ARM_COMPONENTS) - add_library(reborn SHARED src/libreborn.c) + add_library(reborn SHARED src/reborn.c) target_link_libraries(reborn dl reborn-headers) # Install install(TARGETS reborn DESTINATION "${MCPI_LIB_DIR}") diff --git a/libreborn/include/libreborn/exec.h b/libreborn/include/libreborn/exec.h index 81e5c81..76250b1 100644 --- a/libreborn/include/libreborn/exec.h +++ b/libreborn/include/libreborn/exec.h @@ -20,7 +20,6 @@ __attribute__((noreturn)) static inline void safe_execvpe(const char *pathname, } } // Get Binary Directory (Remember To Free) -#define EXE_PATH "/proc/self/exe" static inline char *get_binary_directory() { #ifndef FORCE_PROC_FOR_ROOT_PATH { @@ -31,7 +30,6 @@ static inline char *get_binary_directory() { } } #endif - // Get Path To Current Executable char *exe = realpath("/proc/self/exe", NULL); ALLOC_CHECK(exe); @@ -45,6 +43,9 @@ static inline char *get_binary_directory() { } } + // Set Environment + setenv("MCPI_ROOT_PATH", exe, 1); + // Return return exe; } diff --git a/libreborn/src/libreborn.c b/libreborn/src/reborn.c similarity index 100% rename from libreborn/src/libreborn.c rename to libreborn/src/reborn.c