From: munkyu.im Date: Tue, 30 Jul 2013 05:34:30 +0000 (+0900) Subject: ecp: fix ioctl and windows socket initialized time for windows X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~861 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=17b99c2d479a7755b29ec31bec3e226163c793fa;p=sdk%2Femulator%2Fqemu.git ecp: fix ioctl and windows socket initialized time for windows Signed-off-by: munkyu.im --- diff --git a/tizen/src/ecs.c b/tizen/src/ecs.c index 2527f64f8b..da291e9bbc 100644 --- a/tizen/src/ecs.c +++ b/tizen/src/ecs.c @@ -1003,11 +1003,23 @@ static void ecs_read(ECS_Client *cli) { int read = 0; int to_read_bytes = 0; - if (ioctl(cli->client_fd, FIONREAD, &to_read_bytes) < 0) - { - LOG("ioctl failed"); - return; - } + +#ifndef __WIN32 + if (ioctl(cli->client_fd, FIONREAD, &to_read_bytes) < 0) + { + LOG("ioctl failed"); + return; + } + +#else + unsigned long to_read_bytes_long = 0; + if (ioctlsocket(cli->client_fd, FIONREAD, &to_read_bytes_long) < 0) + { + LOG("ioctl failed"); + return; + } + to_read_bytes = (int)to_read_bytes_long; +#endif LOG("ioctl FIONREAD: %d\n", to_read_bytes); if (to_read_bytes == 0) diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index 7e3905d776..5ca93e6158 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -365,7 +365,6 @@ static void prepare_basic_features(void) g_strlcpy(dns, DEFAULT_QEMU_DNS_IP, strlen(DEFAULT_QEMU_DNS_IP) + 1); check_vm_lock(); - socket_init(); make_vm_lock(); sdb_setup(); /* determine the base port for emulator */ @@ -545,6 +544,9 @@ static int emulator_main(int argc, char *argv[]) } fprintf(stdout, "\nskin args: =========================================\n"); + INFO("socket initialize\n"); + socket_init(); + INFO("qemu main start!\n"); qemu_main(_qemu_argc, _qemu_argv, NULL);