system/core 64-bit cleanup.
This cleans up most of the size-related problems in system/core.
There are still a few changes needed for a clean 64-bit build,
but they look like they might require changes to things like the
fastboot protocol.
Change-Id: I1560425a289fa158e13e2e3173cc3e71976f92c0
diff --git a/toolbox/setconsole.c b/toolbox/setconsole.c
index 0159c07..85ea7c2 100644
--- a/toolbox/setconsole.c
+++ b/toolbox/setconsole.c
@@ -12,12 +12,9 @@
static int activate_thread_switch_vc;
static void *activate_thread(void *arg)
{
- int res;
- int fd = (int)arg;
+ int fd = (int) (uintptr_t) arg;
while(activate_thread_switch_vc >= 0) {
- do {
- res = ioctl(fd, VT_ACTIVATE, (void*)activate_thread_switch_vc);
- } while(res < 0 && errno == EINTR);
+ int res = TEMP_FAILURE_RETRY(ioctl(fd, VT_ACTIVATE, activate_thread_switch_vc));
if (res < 0) {
fprintf(stderr, "ioctl( vcfd, VT_ACTIVATE, vtnum) failed, %d %d %s for %d\n", res, errno, strerror(errno), activate_thread_switch_vc);
}
@@ -131,11 +128,9 @@
activate_thread_switch_vc = switch_vc;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- pthread_create(&thread, &attr, activate_thread, (void*)fd);
-
- do {
- res = ioctl(fd, VT_WAITACTIVE, (void*)switch_vc);
- } while(res < 0 && errno == EINTR);
+ pthread_create(&thread, &attr, activate_thread, (void*) (uintptr_t) fd);
+
+ res = TEMP_FAILURE_RETRY(ioctl(fd, VT_WAITACTIVE, switch_vc));
activate_thread_switch_vc = -1;
if (res < 0) {
fprintf(stderr, "ioctl( vcfd, VT_WAITACTIVE, vtnum) failed, %d %d %s for %d\n", res, errno, strerror(errno), switch_vc);
@@ -157,7 +152,7 @@
}
}
if (mode != -1) {
- if (ioctl(fd, KDSETMODE, (void*)mode) < 0) {
+ if (ioctl(fd, KDSETMODE, mode) < 0) {
fprintf(stderr, "KDSETMODE %d failed\n", mode);
return -1;
}