summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Kroitor <an.kroitor@samsung.com>2016-12-09 15:59:44 +0200
committerAndrii Kroitor <an.kroitor@samsung.com>2016-12-09 16:54:12 +0200
commit518910990c4ece24e963dc0ded88f6b8c2b2fb8e (patch)
tree28c5f4e135cb6f7ebf6ae3180ce12a8719f7836a
parent62a0c41fd3bf8796efec55db52395f13a78fb27f (diff)
downloadefl-518910990c4ece24e963dc0ded88f6b8c2b2fb8e.tar.gz
ethumb_slave: fix work on Windows
Ecore_Fd_Handler doesn't work on Windows as expected. Replaced it with Ecore_Win32_Handler on Windows.
-rw-r--r--src/bin/ethumb_client/ethumbd_slave.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/bin/ethumb_client/ethumbd_slave.c b/src/bin/ethumb_client/ethumbd_slave.c
index 735c8c37e5..09efff52f3 100644
--- a/src/bin/ethumb_client/ethumbd_slave.c
+++ b/src/bin/ethumb_client/ethumbd_slave.c
@@ -47,7 +47,12 @@ static int _log_domain = -1;
struct _Ethumbd_Child
{
+#ifndef _WIN32
Ecore_Fd_Handler *fd_handler;
+#else
+ Ecore_Win32_Handler *fd_handler;
+#endif
+
Ethumb *ethumbt[NETHUMBS];
};
@@ -171,7 +176,13 @@ _ec_free(struct _Ethumbd_Child *ec)
int i;
if (ec->fd_handler)
+ {
+#ifndef _WIN32
ecore_main_fd_handler_del(ec->fd_handler);
+#else
+ ecore_main_win32_handler_del(ec->fd_handler);
+#endif
+ }
for (i = 0; i < NETHUMBS; i++)
{
@@ -694,13 +705,19 @@ _ec_op_setup(struct _Ethumbd_Child *ec)
return 1;
}
+#ifndef _WIN32
static Eina_Bool
_ec_fd_handler(void *data, Ecore_Fd_Handler *fd_handler)
+#else
+static Eina_Bool
+_ec_fd_handler(void *data, Ecore_Win32_Handler *fd_handler EINA_UNUSED)
+#endif
{
struct _Ethumbd_Child *ec = data;
int op_id;
int r;
+#ifndef _WIN32
if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_ERROR))
{
ERR("error on pipein! child exiting...");
@@ -708,6 +725,7 @@ _ec_fd_handler(void *data, Ecore_Fd_Handler *fd_handler)
ecore_main_loop_quit();
return 0;
}
+#endif
r = _ec_read_safe(STDIN_FILENO, &op_id, sizeof(op_id));
if (!r)
@@ -752,9 +770,15 @@ _ec_fd_handler(void *data, Ecore_Fd_Handler *fd_handler)
static void
_ec_setup(struct _Ethumbd_Child *ec)
{
+#ifndef _WIN32
ec->fd_handler = ecore_main_fd_handler_add(
STDIN_FILENO, ECORE_FD_READ | ECORE_FD_ERROR,
_ec_fd_handler, ec, NULL, NULL);
+#else
+ ec->fd_handler = ecore_main_win32_handler_add(
+ GetStdHandle(STD_INPUT_HANDLE),
+ _ec_fd_handler, ec);
+#endif
}
int