X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Ftests%2Fgtlsconsoleinteraction.c;h=81e9119fc826d8ec96afbb5a66d22ecdfb15bf73;hb=cb0ed84d4022e0fba6aaa9e99e258d8d507a90e5;hp=717a83c5fb5b63ca27b8fa0609943e4b584c4019;hpb=058fa6393e368a2134f18df3296c09eb33d8e951;p=platform%2Fupstream%2Fglib.git diff --git a/gio/tests/gtlsconsoleinteraction.c b/gio/tests/gtlsconsoleinteraction.c index 717a83c..81e9119 100644 --- a/gio/tests/gtlsconsoleinteraction.c +++ b/gio/tests/gtlsconsoleinteraction.c @@ -40,8 +40,12 @@ G_DEFINE_TYPE (GTlsConsoleInteraction, g_tls_console_interaction, G_TYPE_TLS_INTERACTION); -#ifdef G_OS_WIN32 +#if defined(G_OS_WIN32) || defined(__BIONIC__) /* win32 doesn't have getpass() */ +#include +#ifndef BUFSIZ +#define BUFSIZ 8192 +#endif static gchar * getpass (const gchar *prompt) { @@ -53,7 +57,11 @@ getpass (const gchar *prompt) for (i = 0; i < BUFSIZ - 1; ++i) { +#ifdef __BIONIC__ + buf[i] = getc (stdin); +#else buf[i] = _getch (); +#endif if (buf[i] == '\r') break; }