From: William A. Rowe Jr Date: Wed, 27 Feb 2002 19:38:09 +0000 (+0000) Subject: Need broader permissions if we are to read and the set the flags that X-Git-Tag: 2.0.33~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d057840899a704974f45073f0aea30c4064fb798;p=thirdparty%2Fapache%2Fhttpd.git Need broader permissions if we are to read and the set the flags that apply to the console stream. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93604 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/win32/wintty.c b/support/win32/wintty.c index acdde94b6da..26a827b2d5f 100644 --- a/support/win32/wintty.c +++ b/support/win32/wintty.c @@ -265,7 +265,7 @@ int main(int argc, char** argv) printerr("SetConsoleTitle() failed (%d)\n", GetLastError()); } - conout = CreateFile("CONOUT$", GENERIC_WRITE, + conout = CreateFile("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, FALSE, OPEN_EXISTING, 0, NULL); if (!conout || conout == INVALID_HANDLE_VALUE) { @@ -281,14 +281,14 @@ int main(int argc, char** argv) printerr("SetConsoleMode(CONOUT, 0x%x) failed (%d)\n", conmode, GetLastError()); } - conin = CreateFile("CONIN$", GENERIC_READ, + conin = CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, FALSE, OPEN_EXISTING, 0, NULL); if (!conin || conin == INVALID_HANDLE_VALUE) { printerr("GetStdHandle(STD_INPUT_HANDLE) failed (%d)\n", GetLastError()); } else if (!GetConsoleMode(conin, &conmode)) { - printerr("GetConsoleMode(CONOUT) failed (%d)\n", GetLastError()); + printerr("GetConsoleMode(CONIN) failed (%d)\n", GetLastError()); } else if (!SetConsoleMode(conin, conmode = ((conmode | newinmode) & ~notinmode))) { printerr("SetConsoleMode(CONIN, 0x%x) failed (%d)\n", conmode, GetLastError());