aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-03-27 12:45:30 -0300
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-03-27 16:14:52 -0300
commit64f221162350f8cfdfaeceeeb1efe65e8206e0f2 (patch)
treee2f7600644e275fd6d943144d39a5a1747811577
parentefl_net_dialer_unix_example: read in loop while "can_read". (diff)
downloadefl-64f221162350f8cfdfaeceeeb1efe65e8206e0f2.tar.gz
ecore_ipc_client_example: win32 doesn't provide getline().
-rw-r--r--src/examples/ecore/ecore_ipc_client_example.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/examples/ecore/ecore_ipc_client_example.c b/src/examples/ecore/ecore_ipc_client_example.c
index c3f3708d17..895126493f 100644
--- a/src/examples/ecore/ecore_ipc_client_example.c
+++ b/src/examples/ecore/ecore_ipc_client_example.c
@@ -57,8 +57,20 @@ static Eina_Bool
_on_stdin(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh EINA_UNUSED)
{
char *line = NULL;
+#ifdef _WIN32
+ char lbuf[4096] = "";
+ ssize_t r;
+ if (fgets(lbuf, sizeof(lbuf), stdin) == NULL)
+ r = -1;
+ else
+ {
+ line = strdup(lbuf);
+ r = strlen(line);
+ }
+#else
size_t len = 0;
ssize_t r = getline(&line, &len, stdin);
+#endif
if (r < 0)
{