mirror of
https://github.com/lammertb/libhttp.git
synced 2025-09-03 01:21:16 +03:00
Create console and attach stdin/stdout/stderr
This commit is contained in:
14
src/main.c
14
src/main.c
@@ -1500,20 +1500,16 @@ static int MakeConsole() {
|
||||
|
||||
ok = (GetConsoleWindow() != NULL);
|
||||
if (ok) {
|
||||
freopen("CON", "a", stdin);
|
||||
freopen("CON", "a", stdout);
|
||||
freopen("CON", "a", stderr);
|
||||
freopen("CONIN$", "r", stdin);
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
}
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
CONSOLE_SCREEN_BUFFER_INFO coninfo;
|
||||
|
||||
SetConsoleTitle(server_name);
|
||||
|
||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo);
|
||||
if (coninfo.dwSize.Y<500) coninfo.dwSize.Y = 500;
|
||||
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user