summaryrefslogtreecommitdiff
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-29 12:44:19 -0300
commit8f6e3265b6c2d66309fec5fe27f1e91ad9568302 (patch)
treec4e41ce83c9d5e679bb401ec157df7827c344234
parentbfe2988f4d5c9ed5b94022a6003fbc12fe47291a (diff)
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
57_on_stdin(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh EINA_UNUSED) 57_on_stdin(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh EINA_UNUSED)
58{ 58{
59 char *line = NULL; 59 char *line = NULL;
60#ifdef _WIN32
61 char lbuf[4096] = "";
62 ssize_t r;
63 if (fgets(lbuf, sizeof(lbuf), stdin) == NULL)
64 r = -1;
65 else
66 {
67 line = strdup(lbuf);
68 r = strlen(line);
69 }
70#else
60 size_t len = 0; 71 size_t len = 0;
61 ssize_t r = getline(&line, &len, stdin); 72 ssize_t r = getline(&line, &len, stdin);
73#endif
62 74
63 if (r < 0) 75 if (r < 0)
64 { 76 {