summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-04-17 15:34:47 +0200
committerJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-04-20 14:24:24 +0300
commit840002bd948a60fb0ccb3f63c5e8516d2d2f5a32 (patch)
tree3e1cf26a1d0953d6a6755411ab5c85e0d7a316b5
parent1e910371d7544764724c8045d2f71954cbaae597 (diff)
Avoid freopen()'ing stdinstable
It doesn't really do anything here as binary and text streams are the same on linux. It's discouraged by the Open Group. Finally, I can't verify that it doesn't discard data from the input stream. That would be bad. Change-Id: I1a9a020122ba7835f95b7113f5e47c83378c1787 Reviewed-by: Kari Hautamäki <kari.hautamaki@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rw-r--r--app/perfstdin.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/app/perfstdin.cpp b/app/perfstdin.cpp
index 5a70976..a5d237c 100644
--- a/app/perfstdin.cpp
+++ b/app/perfstdin.cpp
@@ -26,9 +26,6 @@ bool PerfStdin::open(QIODevice::OpenMode mode)
{
if (!(mode & QIODevice::ReadOnly) || (mode & QIODevice::WriteOnly))
return false;
- char cReadMode[3] = {'r', (mode & QIODevice::Text) == 0 ? 'b' : '\0', '\0'};
- if (!freopen(0, cReadMode, stdin))
- return false;
return QIODevice::open(mode);
}