From e4d9a4f2fdc098e3447d4a81bc4dbb2f9acd5e53 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 4 Nov 2014 21:43:49 -0800 Subject: Move system() for setnsfpn to a separate function. --- postinst.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3