mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
在CentOS等系统中,访问/dev会有ioctl的系统调用,可能导致spj程序出错,这里改为重定向到文件中。
This commit is contained in:
parent
88f61c8cee
commit
941fa8e5fc
@ -13,7 +13,7 @@ def file_exists(path):
|
|||||||
|
|
||||||
def spj(path, max_cpu_time, max_memory, in_path, user_out_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):
|
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,
|
max_cpu_time=max_cpu_time, max_memory=max_memory,
|
||||||
args=[in_path, user_out_path], env=["PATH=" + os.environ.get("PATH", "")],
|
args=[in_path, user_out_path], env=["PATH=" + os.environ.get("PATH", "")],
|
||||||
use_sandbox=True, use_nobody=True)
|
use_sandbox=True, use_nobody=True)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user