diff options
author | comex | 2015-01-28 02:54:21 -0500 |
---|---|---|
committer | comex | 2015-01-28 02:54:21 -0500 |
commit | 6536ff3cd2b2fac8a2068058735e77479341f19f (patch) | |
tree | aa7186817874fc41ce8087cdcd4d520dbbc9b45a /ios-bootstrap/unrestrict-me.c | |
parent | sorta (diff) | |
download | substitute-6536ff3cd2b2fac8a2068058735e77479341f19f.tar.gz |
***yawn***
Diffstat (limited to '')
-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) { |