Commit c8ca023b authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Oswald Buddenhagen

Close write channel of external processes

Prevents external process from waiting for user input.

Merge-request: 347
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@nokia.com>

Change-Id: Icfd3e39a83ba945ebf89c1cbb2157e2a1c9f4d89
parent 441966fa
......@@ -373,6 +373,7 @@ SynchronousProcessResponse SynchronousProcess::run(const QString &binary,
// event loop in that case.
m_d->m_binary = binary;
m_d->m_process.start(binary, args, QIODevice::ReadOnly);
m_d->m_process.closeWriteChannel();
if (!m_d->m_startFailure) {
m_d->m_timer.start();
QApplication::setOverrideCursor(Qt::WaitCursor);
......
......@@ -798,7 +798,8 @@ static Utils::SynchronousProcessResponse
process->setProcessChannelMode(QProcess::MergedChannels);
// Start
process->start(binary, arguments);
process->start(binary, arguments, QIODevice::ReadOnly);
process->closeWriteChannel();
Utils::SynchronousProcessResponse response;
if (!process->waitForStarted()) {
response.result = Utils::SynchronousProcessResponse::StartFailed;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment