summaryrefslogtreecommitdiff
path: root/src/bin/ethumb_client/ethumbd_slave.c
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 /src/bin/ethumb_client/ethumbd_slave.c
parent62a0c41fd3bf8796efec55db52395f13a78fb27f (diff)
ethumb_slave: fix work on Windows
Ecore_Fd_Handler doesn't work on Windows as expected. Replaced it with Ecore_Win32_Handler on Windows.
Diffstat (limited to 'src/bin/ethumb_client/ethumbd_slave.c')
-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;
47 47
48struct _Ethumbd_Child 48struct _Ethumbd_Child
49{ 49{
50#ifndef _WIN32
50 Ecore_Fd_Handler *fd_handler; 51 Ecore_Fd_Handler *fd_handler;
52#else
53 Ecore_Win32_Handler *fd_handler;
54#endif
55
51 Ethumb *ethumbt[NETHUMBS]; 56 Ethumb *ethumbt[NETHUMBS];
52}; 57};
53 58
@@ -171,7 +176,13 @@ _ec_free(struct _Ethumbd_Child *ec)
171 int i; 176 int i;
172 177
173 if (ec->fd_handler) 178 if (ec->fd_handler)
179 {
180#ifndef _WIN32
174 ecore_main_fd_handler_del(ec->fd_handler); 181 ecore_main_fd_handler_del(ec->fd_handler);
182#else
183 ecore_main_win32_handler_del(ec->fd_handler);
184#endif
185 }
175 186
176 for (i = 0; i < NETHUMBS; i++) 187 for (i = 0; i < NETHUMBS; i++)
177 { 188 {
@@ -694,13 +705,19 @@ _ec_op_setup(struct _Ethumbd_Child *ec)
694 return 1; 705 return 1;
695} 706}
696 707
708#ifndef _WIN32
697static Eina_Bool 709static Eina_Bool
698_ec_fd_handler(void *data, Ecore_Fd_Handler *fd_handler) 710_ec_fd_handler(void *data, Ecore_Fd_Handler *fd_handler)
711#else
712static Eina_Bool
713_ec_fd_handler(void *data, Ecore_Win32_Handler *fd_handler EINA_UNUSED)
714#endif
699{ 715{
700 struct _Ethumbd_Child *ec = data; 716 struct _Ethumbd_Child *ec = data;
701 int op_id; 717 int op_id;
702 int r; 718 int r;
703 719
720#ifndef _WIN32
704 if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_ERROR)) 721 if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_ERROR))
705 { 722 {
706 ERR("error on pipein! child exiting..."); 723 ERR("error on pipein! child exiting...");
@@ -708,6 +725,7 @@ _ec_fd_handler(void *data, Ecore_Fd_Handler *fd_handler)
708 ecore_main_loop_quit(); 725 ecore_main_loop_quit();
709 return 0; 726 return 0;
710 } 727 }
728#endif
711 729
712 r = _ec_read_safe(STDIN_FILENO, &op_id, sizeof(op_id)); 730 r = _ec_read_safe(STDIN_FILENO, &op_id, sizeof(op_id));
713 if (!r) 731 if (!r)
@@ -752,9 +770,15 @@ _ec_fd_handler(void *data, Ecore_Fd_Handler *fd_handler)
752static void 770static void
753_ec_setup(struct _Ethumbd_Child *ec) 771_ec_setup(struct _Ethumbd_Child *ec)
754{ 772{
773#ifndef _WIN32
755 ec->fd_handler = ecore_main_fd_handler_add( 774 ec->fd_handler = ecore_main_fd_handler_add(
756 STDIN_FILENO, ECORE_FD_READ | ECORE_FD_ERROR, 775 STDIN_FILENO, ECORE_FD_READ | ECORE_FD_ERROR,
757 _ec_fd_handler, ec, NULL, NULL); 776 _ec_fd_handler, ec, NULL, NULL);
777#else
778 ec->fd_handler = ecore_main_win32_handler_add(
779 GetStdHandle(STD_INPUT_HANDLE),
780 _ec_fd_handler, ec);
781#endif
758} 782}
759 783
760int 784int