在CentOS等系统中,访问/dev会有ioctl的系统调用,可能导致spj程序出错,这里改为重定向到文件中。

This commit is contained in:
virusdefender 2016-04-07 21:01:53 +08:00
parent 88f61c8cee
commit 941fa8e5fc

View File

@ -13,7 +13,7 @@ def file_exists(path):
def spj(path, max_cpu_time, max_memory, in_path, user_out_path):
if file_exists(in_path) and file_exists(user_out_path):
result = judger.run(path=path, in_file="/dev/null", out_file="/dev/null",
result = judger.run(path=path, in_file=in_path, out_file="/tmp/spj.out",
max_cpu_time=max_cpu_time, max_memory=max_memory,
args=[in_path, user_out_path], env=["PATH=" + os.environ.get("PATH", "")],
use_sandbox=True, use_nobody=True)