diff options
Diffstat (limited to 'ios-bootstrap/unrestrict-me.c')
-rw-r--r-- | ios-bootstrap/unrestrict-me.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ios-bootstrap/unrestrict-me.c b/ios-bootstrap/unrestrict-me.c index a297471..5a2c6dd 100644 --- a/ios-bootstrap/unrestrict-me.c +++ b/ios-bootstrap/unrestrict-me.c @@ -2,6 +2,8 @@ #include "substitute-internal.h" #include <stdlib.h> #include <syslog.h> +#include <errno.h> +#include <stdio.h> int main(int argc, char **argv) { if (argc != 3) { @@ -22,6 +24,15 @@ int main(int argc, char **argv) { return 1; } + /* double fork to avoid zombies */ + int ret = fork(); + if (ret == -1) { + syslog(LOG_EMERG, "unrestrict-me: fork: %s", strerror(errno)); + return 1; + } else if (ret) { + return 0; + } + char *err = NULL; int sret = substitute_ios_unrestrict((pid_t) pid, should_resume[0] == '1', &err); if (sret) { |