X-Git-Url: https://git.saurik.com/uikittools.git/blobdiff_plain/d9e253f67bf1ec5a63fec7061a4b8899c6ba8d0e..adefb9f152a2bac643bc8e65927c226080787db9:/iomfsetgamma.c?ds=sidebyside diff --git a/iomfsetgamma.c b/iomfsetgamma.c index 8f02a4c..6dbc2e7 100644 --- a/iomfsetgamma.c +++ b/iomfsetgamma.c @@ -73,20 +73,21 @@ int main(int argc, char *argv[]) { uint32_t data[0xc00 / sizeof(uint32_t)]; memset(data, 0, sizeof(data)); - FILE *file = fopen("/tmp/.iomfgamma.dat", "r"); + FILE *file = fopen("/tmp/.iomfgamma.dat", "rb"); 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"); + file = fopen("/tmp/.iomfgamma.dat", "rb"); + _assert(file != NULL); } fread(data, 1, sizeof(data), file);