]> git.saurik.com Git - cydia.git/commitdiff
Prefer SBReboot() (when available) to system("reboot").
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 2 Dec 2010 14:23:02 +0000 (06:23 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Fri, 3 Dec 2010 09:16:44 +0000 (01:16 -0800)
MobileCydia.mm
iPhonePrivate.h
makefile

index 872e818cc12d337f286ddff1f1787d17318398f2..6121e6eb6d3bac72ec5f8c4d7af6c7d3f6cf6bbf 100644 (file)
@@ -4449,7 +4449,10 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
         break;
 
         case 4:
-            system("reboot");
+            if (void (*SBReboot)(mach_port_t) = reinterpret_cast<void (*)(mach_port_t)>(dlsym(RTLD_DEFAULT, "SBReboot")))
+                SBReboot(SBSSpringBoardServerPort());
+            else
+                system("reboot");
         break;
     }
 }
index e6a79dce45a5a7d0102be9624a60231508e27cbe..9778f9dadf30fe83dca4cf4b7ac64c5fb2a13d4f 100644 (file)
@@ -350,6 +350,7 @@ extern float const UIWebViewGrowsAndShrinksToFitHeight;
 extern float const UIWebViewScalesToFitScale;
 // }}}
 // extern "C" *(); {{{
+extern "C" mach_port_t SBSSpringBoardServerPort();
 extern "C" UIImage *_UIImageWithName(NSString *name);
 extern "C" void UISetColor(CGColorRef color);
 // }}}
index d9326179667ea6c06d645258e896eaf83c2836cb..70c543298c78e96c96f895057e58bff9051614f8 100644 (file)
--- a/makefile
+++ b/makefile
@@ -30,6 +30,7 @@ link += -framework GraphicsServices
 link += -framework IOKit
 link += -framework JavaScriptCore
 link += -framework QuartzCore
+link += -framework SpringBoardServices
 link += -framework SystemConfiguration
 link += -framework WebCore
 link += -framework WebKit