[libcalamares] Close stdin on process jobs

- This avoids processes that wait on stdin, and e.g. improves
   reaction to having just "cat" (no file) in a command, or
   a package manager that asks for input.
This commit is contained in:
Adriaan de Groot 2019-06-07 16:11:54 +02:00
parent 4e13f780f1
commit 4f221b41d1

View File

@ -214,8 +214,8 @@ System::runCommand(
if ( !stdInput.isEmpty() ) if ( !stdInput.isEmpty() )
{ {
process.write( stdInput.toLocal8Bit() ); process.write( stdInput.toLocal8Bit() );
process.closeWriteChannel();
} }
process.closeWriteChannel();
if ( !process.waitForFinished( timeoutSec ? ( timeoutSec * 1000 ) : -1 ) ) if ( !process.waitForFinished( timeoutSec ? ( timeoutSec * 1000 ) : -1 ) )
{ {