Skip to content

Commit b65a0d9

Browse files
committed
Use apprun_env_set in configure_embed_libc and configure_system_libc to have better logging
1 parent 0931fa0 commit b65a0d9

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/apprun/runtime_interpreter.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "hooks/environment.h"
4040

4141
#include "runtime_interpreter.h"
42+
#include "runtime_environment.h"
4243

4344

4445
char* parse_ld_trace_line_path(const char* line) {
@@ -139,8 +140,8 @@ void configure_embed_libc() {
139140
#endif
140141
char* ld_library_path = apprun_shell_expand_variables("$APPDIR_LIBRARY_PATH:$LIBC_LIBRARY_PATH:"
141142
"$"APPRUN_ENV_ORIG_PREFIX"LD_LIBRARY_PATH", NULL);
142-
setenv("LD_LIBRARY_PATH", ld_library_path, 1);
143-
setenv(APPRUN_ENV_STARTUP_PREFIX"LD_LIBRARY_PATH", ld_library_path, 1);
143+
144+
apprun_env_set("LD_LIBRARY_PATH", ld_library_path, "", ld_library_path);
144145
free(ld_library_path);
145146
}
146147

@@ -150,8 +151,8 @@ void configure_system_libc() {
150151
#endif
151152
char* ld_library_path = apprun_shell_expand_variables("$APPDIR_LIBRARY_PATH:"
152153
"$"APPRUN_ENV_ORIG_PREFIX"LD_LIBRARY_PATH", NULL);
153-
setenv("LD_LIBRARY_PATH", ld_library_path, 1);
154-
setenv(APPRUN_ENV_STARTUP_PREFIX"LD_LIBRARY_PATH", ld_library_path, 1);
154+
155+
apprun_env_set("LD_LIBRARY_PATH", ld_library_path, "", ld_library_path);
155156
free(ld_library_path);
156157
}
157158

@@ -234,6 +235,6 @@ void deploy_interpreter(char* path) {
234235
if (access(target_path, F_OK) == -1)
235236
apprun_file_copy(path, target_path);
236237

237-
chmod(target_path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH );
238+
chmod(target_path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
238239
}
239240

0 commit comments

Comments
 (0)