Clean Up Some Code, No Noticeable Difference
minecraft-pi-reborn/pipeline/head This commit looks good Details

pull/23/head
TheBrokenRail 1 year ago
parent 99b709fea7
commit d372169c79

@ -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
{

@ -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}")

@ -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;
}

Loading…
Cancel
Save