aboutsummaryrefslogtreecommitdiff
path: root/ios-bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'ios-bootstrap')
-rw-r--r--ios-bootstrap/unrestrict.c9
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;
}