summaryrefslogtreecommitdiff
path: root/postinst.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2014-11-05 03:20:57 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2014-11-05 03:20:57 -0800
commit5530e23458e832a9840ce6f0182f1ebdb7c9021b (patch)
treea2ba4d0d3f3674cafc8b9731f69e663cc20ed4e9 /postinst.mm
parentc623466b01da346cafe5cdd1039ed608326d9a5c (diff)
Restart SpringBoard in the case that we MoveStash.
Diffstat (limited to 'postinst.mm')
-rw-r--r--postinst.mm20
1 files changed, 13 insertions, 7 deletions
diff --git a/postinst.mm b/postinst.mm
index e5658d2..b380d64 100644
--- a/postinst.mm
+++ b/postinst.mm
@@ -79,11 +79,6 @@ static bool FixProtections() {
}
}
- if (!MoveStash()) {
- fprintf(stderr, "failed to move stash\n");
- return false;
- }
-
return true;
}
@@ -188,9 +183,18 @@ int main(int argc, const char *argv[]) {
NSAutoreleasePool *pool([[NSAutoreleasePool alloc] init]);
- if (kCFCoreFoundationVersionNumber >= 1000)
+ bool restart(false);
+
+ if (kCFCoreFoundationVersionNumber >= 1000) {
if (!FixProtections())
return 1;
+ if (MoveStash())
+ restart = true;
+ else {
+ fprintf(stderr, "failed to move stash\n");
+ return 1;
+ }
+ }
size_t size;
sysctlbyname("kern.osversion", NULL, &size, NULL, 0);
@@ -249,7 +253,9 @@ int main(int argc, const char *argv[]) {
FixPermissions();
- if (FixApplications())
+ restart |= FixApplications();
+
+ if (restart)
Finish("restart");
[pool release];