From 4f6a9762123126fcfbd2f1b52755565531d96c30 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Mon, 9 Mar 2015 13:58:54 -0500 Subject: Make TWRP compile for x86-64 CPU target Also add a short while loop to wait for fb0 to be created as was needed on the x86-64 target for the Android emulator. Change-Id: Ib1b87bea028ac3eac0541283334a0157cdfbce11 --- minuitwrp/graphics.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'minuitwrp') diff --git a/minuitwrp/graphics.c b/minuitwrp/graphics.c index 10d74a7a7..1465ce99b 100644 --- a/minuitwrp/graphics.c +++ b/minuitwrp/graphics.c @@ -163,12 +163,17 @@ int getFbYres (void) { static int get_framebuffer(GGLSurface *fb) { - int fd; + int fd, index = 0; void *bits; fd = open("/dev/graphics/fb0", O_RDWR); + while (fd < 0 && index < 10) { + usleep(1000); + fd = open("/dev/graphics/fb0", O_RDWR); + index++; + } if (fd < 0) { - perror("cannot open fb0"); + perror("cannot open fb0\n"); return -1; } -- cgit v1.2.3