summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-10-08 12:37:45 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-10-08 12:37:45 -0700
commite07d8f4f439b50d2dd8804730dcd8af72f0d41b6 (patch)
tree16893d7236cc2cf3a0fe880f4068497085317bbb
parent2dd5da1605dad121be0de8d4be4361c58808b350 (diff)
Reorganize calls to fopen, for assert safety.
-rw-r--r--iomfsetgamma.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/iomfsetgamma.c b/iomfsetgamma.c
index 8f02a4c..71159d5 100644
--- a/iomfsetgamma.c
+++ b/iomfsetgamma.c
@@ -75,18 +75,19 @@ int main(int argc, char *argv[]) {
FILE *file = fopen("/tmp/.iomfgamma.dat", "r");
if (file == NULL) {
- file = fopen("/tmp/.iomfgamma.dat", "wb");
-
$IOMobileFramebufferGetGammaTable = dlsym(RTLD_DEFAULT, "IOMobileFramebufferGetGammaTable");
-
_assert($IOMobileFramebufferGetGammaTable != NULL);
error = $IOMobileFramebufferGetGammaTable(fb, data);
_assert(error == 0);
+ file = fopen("/tmp/.iomfgamma.dat", "wb");
+ _assert(file != NULL);
+
fwrite(data, 1, sizeof(data), file);
fclose(file);
file = fopen("/tmp/.iomfgamma.dat", "r");
+ _assert(file != NULL);
}
fread(data, 1, sizeof(data), file);