Skip to content
This repository has been archived by the owner on Dec 6, 2020. It is now read-only.

Commit

Permalink
fix: 尝试修复 http://blog.lightning34.cn/?p=527 中提到的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
WAAutoMaton committed Apr 17, 2019
1 parent c39c88e commit c6b83bc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions judgingthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,10 @@ void JudgingThread::runProgram()
#endif

#ifdef LEMON_OS_UNIX
bool ok = QFile::copy(QCoreApplication::applicationDirPath() + "/watcher/watcher_unix",
workingDirectory + "watcher");
QProcess::execute(QString("chmod +wx \"") + workingDirectory + "watcher" + "\"");
// bool ok = QFile::copy(QCoreApplication::applicationDirPath() + "/watcher/watcher_unix",
// workingDirectory + "watcher");
QProcess::execute(QString(R"(chmod +wx "%1/watcher/watcher_unix")")
.arg(QCoreApplication::applicationDirPath()));

QProcess *runner = new QProcess(this);
QStringList argumentsList;
Expand All @@ -846,7 +847,7 @@ void JudgingThread::runProgram()
argumentsList << QString("%1").arg(memoryLimit);
runner->setProcessEnvironment(environment);
runner->setWorkingDirectory(workingDirectory);
runner->start(workingDirectory + "watcher", argumentsList);
runner->start(QCoreApplication::applicationDirPath() + "/watcher/watcher_unix", argumentsList);
if (!runner->waitForStarted(-1)) {
delete runner;
score = 0;
Expand Down

0 comments on commit c6b83bc

Please sign in to comment.