From 1b120913b3664e7171c2c3fe991aba0b634a0c73 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 22 Mar 2011 19:49:27 -0700 Subject: Use double-ExecFork() rather than system() double-subshell. --- MobileCydia.mm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'MobileCydia.mm') 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"); } -- cgit v1.2.3