]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Need broader permissions if we are to read and the set the flags that
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 27 Feb 2002 19:38:09 +0000 (19:38 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 27 Feb 2002 19:38:09 +0000 (19:38 +0000)
  apply to the console stream.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93604 13f79535-47bb-0310-9956-ffa450edef68

support/win32/wintty.c

index acdde94b6daad18ee1a9f3afbc8d4ab5d02c5d5d..26a827b2d5f44ae3b7ce0133bb4c9f7d26a842f3 100644 (file)
@@ -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());