summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2013-03-26 10:34:21 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2013-03-26 10:34:21 +0100
commitdb65e4f537c8774b0f6fe92a08cd28905f7b65a9 (patch)
tree4b8b5e5a5b1c8a6ed6beca8163d0bad985a33a4a /libmysql
parentbfac7d637f0118481b0aa35ebd1d9711b90baadc (diff)
downloadmariadb-git-db65e4f537c8774b0f6fe92a08cd28905f7b65a9.tar.gz
Fixes for Windows XP
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/get_password.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libmysql/get_password.c b/libmysql/get_password.c
index ffb08c46aa1..e704aec8337 100644
--- a/libmysql/get_password.c
+++ b/libmysql/get_password.c
@@ -62,12 +62,13 @@
/* were just going to fake it here and get input from the keyboard */
void get_tty_password_buff(const char *opt_message, char *to, size_t length)
{
- HANDLE consoleinput;
+ HANDLE consoleinput;
DWORD oldstate;
char *pos=to,*end=to+length-1;
int i=0;
- consoleinput= CreateFile("CONIN$", GENERIC_WRITE | GENERIC_READ, 0 , NULL, 0, 0, NULL);
+ consoleinput= CreateFile("CONIN$", GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ ,
+ NULL, OPEN_EXISTING, 0, NULL);
if (consoleinput == NULL || consoleinput == INVALID_HANDLE_VALUE)
{
/* This is a GUI application or service without console input, bail out. */
@@ -76,11 +77,11 @@ void get_tty_password_buff(const char *opt_message, char *to, size_t length)
}
_cputs(opt_message ? opt_message : "Enter password: ");
- /*
- Switch to raw mode (no line input, no echo input).
- Allow Ctrl-C handler with ENABLE_PROCESSED_INPUT.
- */
- GetConsoleMode(consoleinput, &oldstate);
+ /*
+ Switch to raw mode (no line input, no echo input).
+ Allow Ctrl-C handler with ENABLE_PROCESSED_INPUT.
+ */
+ GetConsoleMode(consoleinput, &oldstate);
SetConsoleMode(consoleinput, ENABLE_PROCESSED_INPUT);
for (;;)
{