diff options
author | comex | 2015-01-29 22:11:50 -0500 |
---|---|---|
committer | comex | 2015-01-29 22:11:50 -0500 |
commit | ff9bea25b5fb3034103dfe6f973255a3bf1f6bce (patch) | |
tree | 4ffad035aa24987286d222d7a9d245d46bbade3e | |
parent | fix bundle-loader (diff) | |
download | substitute-ff9bea25b5fb3034103dfe6f973255a3bf1f6bce.tar.gz |
fix another unrestrict bug *sigh*
-rw-r--r-- | ios-bootstrap/unrestrict.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ios-bootstrap/unrestrict.c b/ios-bootstrap/unrestrict.c index d8d14dd..11988b1 100644 --- a/ios-bootstrap/unrestrict.c +++ b/ios-bootstrap/unrestrict.c @@ -70,11 +70,12 @@ int main(int argc, char **argv) { * TODO cleanup */ char buf[PROC_PIDFDVNODEINFO_SIZE]; - int ret = proc_pidfdinfo(pid, 255, PROC_PIDFDVNODEINFO, - buf, sizeof(buf)); - if (ret == -1 && errno == EBADF) { + /* A bug in proc_pidfdinfo makes it never return -1. Yuck. */ + errno = 0; + proc_pidfdinfo(pid, 255, PROC_PIDFDVNODEINFO, buf, sizeof(buf)); + if (errno == EBADF) { break; - } else if (ret == -1) { + } else if (errno) { ib_log("proc_pidfdinfo: %s", strerror(errno)); goto fail; } |