return [[NSString stringWithUTF8String:page] stringByAppendingString:path];
}
+static void ReapZombie(pid_t pid) {
+ int status;
+ wait:
+ if (waitpid(pid, &status, 0) == -1)
+ if (errno == EINTR)
+ goto wait;
+ else _assert(false);
+}
+
static _finline void UpdateExternalStatus(uint64_t newStatus) {
int notify_token;
if (notify_register_check("com.saurik.Cydia.status", ¬ify_token) == NOTIFY_STATUS_OK) {
fclose(du);
} else _assert(close(fds[0]));
- int status;
- wait:
- if (waitpid(pid, &status, 0) == -1)
- if (errno == EINTR)
- goto wait;
- else _assert(false);
+ ReapZombie(pid);
return value;
}
_assert(false);
}
- _forever {
- int status;
- int result(waitpid(pid, &status, 0));
-
- if (result != -1) {
- _assert(result == pid);
- break;
- }
- }
+ ReapZombie(pid);
}
- (void) onIgnored:(id)control {
[self removeStashController];
- if (ExecFork() == 0) {
+ pid_t pid(ExecFork());
+ if (pid == 0) {
execlp("launchctl", "launchctl", "stop", "com.apple.SpringBoard", NULL);
perror("launchctl stop");
+ exit(0);
}
+
+ ReapZombie(pid);
}
- (void) setupViewControllers {