Try another way to run jetsamctl
This commit is contained in:
1 parent
f52ebdbbcd
commit
75dd5ec41f
1 file changed
+2
-1
@@ -108,9 +108,9 @@ int launchJVM(int argc, char *argv[]) {
|
||||
// iOS jetsam memory bypass, requires jetsamctl and sudo. Optional.
|
||||
if( access("/usr/bin/jetsamctl", F_OK ) == 0 ) {
|
||||
debug("[Pre-init] jetsamctl was found. Overriding memory limits.");
|
||||
setuid(0);
|
||||
pid_t pid;
|
||||
char *argv[] = {
|
||||
"/usr/bin/sudo",
|
||||
"/usr/bin/jetsamctl",
|
||||
"-l",
|
||||
"$(awk -v MEM=$(sysctl -a | grep memsize | cut -b 13-26) 'BEGIN { print ( MEM / 1024 / 1024 ) }' | cut -b 1-4)",
|
||||
@@ -119,6 +119,7 @@ int launchJVM(int argc, char *argv[]) {
|
||||
};
|
||||
|
||||
posix_spawn(&pid, argv[0], NULL, NULL, argv, environ);
|
||||
setuid(501);
|
||||
debug("[Pre-init] jetsamctl finished successfully.");
|
||||
} else {
|
||||
debug("[Pre-Init] jetsamctl was not found. If you wish to prevent jetsam-related crashes, install jetsamctl 0.2 or later.");
|
||||
|
||||
Reference in new issue
Block a user