Enrico Forestieri wrote:
> On Fri, Jul 16, 2010 at 11:15:25AM +0200, Peter Kümmel wrote:
>> Enrico Forestieri wrote:
>>> @@ -254,6 +254,8 @@
>>> // Check whether we have to simply throw away the output.
>>> if (out_file_ != os::nulldev())
>>> process_->setStandardOutputFile(toqstr(out_file_));
>>> + // Don't output to terminal if stdout is redirected
>>> + terminal_out_exists_ = false;
>>> }
>>>
>>> Then, are you sure that sending binary data also to the progress
>>> interface doesn't cause any harm?
>> I think this is addressed by setStandardOutputFile:
>>
>> When there is a outfile and it is not nulldev then the output is redirected
>> to the file: process_->setStandardOutputFile(toqstr(out_file_));
>>
>> setStandardOutputFile:
>> "Redirects the process' standard output to the file fileName.
>> When the redirection is in place, the standard output read channel
>> is closed: reading from it using read() will always fail,
>> as will readAllStandardOutput()."
>
> Nonetheless, can you please add those two simple lines?
> I don't have time to check and would feel more comfortable.
>
See patch:
if (!out_file_.empty()) {
+ // Don't output to terminal if stdout is redirected
+ use_stdout_ = false;
// Check whether we have to simply throw away the output.
if (out_file_ != os::nulldev())
process_->setStandardOutputFile(toqstr(out_file_));