From 6536ff3cd2b2fac8a2068058735e77479341f19f Mon Sep 17 00:00:00 2001 From: comex Date: Wed, 28 Jan 2015 02:54:21 -0500 Subject: ***yawn*** --- ios-bootstrap/unrestrict-me.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ios-bootstrap/unrestrict-me.c') 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 #include +#include +#include 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) { -- cgit v1.2.3