Fix problem with the nul device on Windows.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29663 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2009-05-14 00:12:07 +00:00
parent 812f41a384
commit 2301c5af8f

View File

@ -98,9 +98,11 @@ int Systemcall::startscript(Starttype how, string const & what)
// Qt won't start the process if we redirect stdout/stderr in
// this way and they are not connected to a terminal (maybe
// because we were launched from some desktop GUI).
if (!outfile.empty())
process->setStandardOutputFile(toqstr(outfile));
else if (os::is_terminal(os::STDOUT))
if (!outfile.empty()) {
// Check whether we have to simply throw away the output.
if (outfile != os::nulldev())
process->setStandardOutputFile(toqstr(outfile));
} else if (os::is_terminal(os::STDOUT))
process->setStandardOutputFile(toqstr(os::stdoutdev()));
if (os::is_terminal(os::STDERR))
process->setStandardErrorFile(toqstr(os::stderrdev()));