mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-08 10:51:03 +00:00
Restore line buffered output at least on posix systems. I failed to do
that on Windows, as using CONOUT$ in place of /dev/stdout didn't work. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29642 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
4963d9ec29
commit
cd9b169d76
@ -60,6 +60,12 @@ int Systemcall::startscript(Starttype how, string const & what)
|
|||||||
#else
|
#else
|
||||||
QString cmd = QString::fromLocal8Bit(what.c_str());
|
QString cmd = QString::fromLocal8Bit(what.c_str());
|
||||||
QProcess * process = new QProcess;
|
QProcess * process = new QProcess;
|
||||||
|
#ifndef WIN32
|
||||||
|
if (isatty(1))
|
||||||
|
process->setStandardOutputFile(toqstr("/dev/stdout"));
|
||||||
|
if (isatty(2))
|
||||||
|
process->setStandardErrorFile(toqstr("/dev/stderr"));
|
||||||
|
#endif
|
||||||
process->start(cmd);
|
process->start(cmd);
|
||||||
if (!process->waitForStarted(3000)) {
|
if (!process->waitForStarted(3000)) {
|
||||||
LYXERR0("Qprocess " << cmd << " did not start!");
|
LYXERR0("Qprocess " << cmd << " did not start!");
|
||||||
@ -86,8 +92,10 @@ int Systemcall::startscript(Starttype how, string const & what)
|
|||||||
LYXERR0("state " << process->state());
|
LYXERR0("state " << process->state());
|
||||||
LYXERR0("status " << process->exitStatus());
|
LYXERR0("status " << process->exitStatus());
|
||||||
}
|
}
|
||||||
|
#ifdef WIN32
|
||||||
cout << fromqstr(QString::fromLocal8Bit(process->readAllStandardOutput().data())) << endl;
|
cout << fromqstr(QString::fromLocal8Bit(process->readAllStandardOutput().data())) << endl;
|
||||||
cerr << fromqstr(QString::fromLocal8Bit(process->readAllStandardError().data())) << endl;
|
cerr << fromqstr(QString::fromLocal8Bit(process->readAllStandardError().data())) << endl;
|
||||||
|
#endif
|
||||||
killProcess(process);
|
killProcess(process);
|
||||||
return exit_code;
|
return exit_code;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user