summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2014-11-04 21:43:49 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2014-11-04 21:43:49 -0800
commite4d9a4f2fdc098e3447d4a81bc4dbb2f9acd5e53 (patch)
treea0d53b1f3284db9aca99eb8702b3b0cfe4534366
parent6c4239e5a483511e5ca2f2c8be2c27b51cf50f93 (diff)
Move system() for setnsfpn to a separate function.
-rw-r--r--postinst.mm6
1 files changed, 5 insertions, 1 deletions
diff --git a/postinst.mm b/postinst.mm
index 55739e0..c67cce5 100644
--- a/postinst.mm
+++ b/postinst.mm
@@ -24,10 +24,14 @@ void Finish(const char *finish) {
fclose(fout);
}
+static bool setnsfpn(const char *path) {
+ return system([[NSString stringWithFormat:@"/usr/libexec/cydia/setnsfpn %s", path] UTF8String]) == 0;
+}
+
static bool FixProtections() {
for (const char *path : (const char *[]) {"/var/lib", "/var/cache", "/var/stash"}) {
mkdir(path, 0755);
- if (system([[NSString stringWithFormat:@"/usr/libexec/cydia/setnsfpn %s", path] UTF8String]) != 0) {
+ if (!setnsfpn(path)) {
fprintf(stderr, "failed to setnsfpn %s\n", path);
return false;
}