summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-22 19:49:27 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-22 19:49:27 -0700
commit1b120913b3664e7171c2c3fe991aba0b634a0c73 (patch)
tree4408be9bdc2ef7b2f21c9e589ee3172c2a970d7b
parent7cc1e4970a531821c8d6ea06357670ec8d4bd3a4 (diff)
Use double-ExecFork() rather than system() double-subshell.
-rw-r--r--MobileCydia.mm17
1 files changed, 15 insertions, 2 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 17b6b12..a1433db 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -5226,8 +5226,21 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
}
- (void) reloadSpringBoard {
- system("(/usr/bin/sbreload &)");
- sleep(60);
+ pid_t pid(ExecFork());
+ if (pid == 0) {
+ pid_t pid(ExecFork());
+ if (pid == 0) {
+ execl("/usr/bin/sbreload", "sbreload", NULL);
+ perror("sbreload");
+ exit(0);
+ }
+
+ exit(0);
+ }
+
+ ReapZombie(pid);
+
+ sleep(15);
system("/usr/bin/killall SpringBoard");
}