]> git.saurik.com Git - cydia.git/commitdiff
Use double-ExecFork() rather than system() double-subshell.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 23 Mar 2011 02:49:27 +0000 (19:49 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 23 Mar 2011 02:49:27 +0000 (19:49 -0700)
MobileCydia.mm

index 17b6b126c802218310e60f3757177a0507efff25..a1433db013f94855821179ebf704483ef47e8a6e 100644 (file)
@@ -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");
 }