AppImageKit-checkrt/AppRun.c.patch

45 lines
1.6 KiB
Diff
Raw Normal View History

2017-04-26 13:27:46 +00:00
--- a/AppRun.c
+++ b/AppRun.c
2017-12-20 21:55:39 +00:00
@@ -38,7 +38,7 @@
exit( 1 ); \
} while (0);
-#define NEW_LD_LIBRARY_PATH "LD_LIBRARY_PATH=./lib/:./lib/i386-linux-gnu/:./lib/x86_64-linux-gnu/:./lib32/:./lib64/:../lib/:../lib/i386-linux-gnu/:../lib/x86_64-linux-gnu/:../lib32/:../lib64/:%s"
+#define NEW_LD_LIBRARY_PATH "LD_LIBRARY_PATH=%s./lib/:./lib/i386-linux-gnu/:./lib/x86_64-linux-gnu/:./lib32/:./lib64/:../lib/:../lib/i386-linux-gnu/:../lib/x86_64-linux-gnu/:../lib32/:../lib64/:%s"
#define NEW_PATH "PATH=./bin/:./sbin/:./games/:../bin/:../sbin/:%s"
#define NEW_PYTHONPATH "PYTHONPATH=./share/pyshared/:%s"
#define NEW_XDG_DATA_DIRS "XDG_DATA_DIRS=./share/:%s"
@@ -138,8 +138,8 @@
char *env, *new_env[7];
env = getenv("LD_LIBRARY_PATH") ?: "";
- new_env[0] = malloc( strlen(NEW_LD_LIBRARY_PATH) + strlen(env) );
- sprintf( new_env[0], NEW_LD_LIBRARY_PATH, env );
+ new_env[0] = malloc( strlen(NEW_LD_LIBRARY_PATH) + strlen(optional) + strlen(env) );
+ sprintf( new_env[0], NEW_LD_LIBRARY_PATH, optional, env );
// printf( " using %s\n", new_env[0] );
putenv( new_env[0] );
@@ -179,6 +179,11 @@
// printf( " using %s\n", new_env[6] );
putenv( new_env[6] );
+ checkrt();
+
+ if (optional_ld_preload)
+ putenv(optional_ld_preload);
2017-12-20 21:55:39 +00:00
+
/* Run */
ret = execvp(executable, argv);
2017-04-26 13:27:46 +00:00
2017-12-20 21:55:39 +00:00
@@ -187,6 +192,9 @@
die( "Error executing '%s'; return code: %d\n", executable, ret );
}
+ free(optional);
+ if (optional_ld_preload)
+ free(optional_ld_preload);
2017-12-20 21:55:39 +00:00
free(new_env[6]);
free(new_env[5]);
free(new_env[4]);