diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-02-12 11:45:13 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-02-12 12:00:56 +0000 |
commit | 25ddba75f0767ef1150c3896fde5c50bc65147c9 (patch) | |
tree | 6cc27751b0cf2550a446d4cf7dae6a042648e40c | |
parent | 5222205d9acca1107507bfdeebaab194157012e0 (diff) |
On Windows, set stdin to binary4.9
Otherwise we receive junk. Apparently there are even ways to close stdin
from the outside.
Fixes: QTCREATORBUG-21971
Change-Id: I87978ca3d0001026f63fd948db8cd95da674a953
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | app/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/main.cpp b/app/main.cpp index 5eba3db..c2174a4 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -223,10 +223,14 @@ int main(int argc, char *argv[]) parser.value(port).toUShort()); infile.reset(socket); } else { - if (parser.isSet(input)) + if (parser.isSet(input)) { infile.reset(new QFile(parser.value(input))); - else + } else { +#ifdef Q_OS_WIN + _setmode(fileno(stdin), O_BINARY); +#endif infile.reset(new PerfStdin); + } } bool ok = false; |