From ab8ede1c5d9a64be0d664ae0c6b9c90ae2a47ea4 Mon Sep 17 00:00:00 2001 From: Vrganj Date: Sun, 31 Jan 2021 18:24:11 +0100 Subject: [PATCH 1/2] Run Java directly to avoid grep --- lxc/executors/java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lxc/executors/java b/lxc/executors/java index 5539c4a..2818d88 100755 --- a/lxc/executors/java +++ b/lxc/executors/java @@ -1,7 +1,5 @@ #!/bin/bash -cd /tmp/$2 -name=$(grep -Po "(?<=\n|\A)\s*(public\s+)?(class|interface)\s+\K([^\/\\\\\n\s{]+)" code.code) -cp code.code $name.java -javac $name.java -timeout -s KILL 3 xargs -a args.args -d '\n' java $name < stdin.stdin +cp code.code interim.java +timeout -s KILL 10 xargs -a args.args -d '\n' java interim.java < stdin.stdin + From e169d0cab8750e809148ce0429f29e00c0f6f4f9 Mon Sep 17 00:00:00 2001 From: TitouanT Date: Mon, 1 Feb 2021 01:21:20 +0100 Subject: [PATCH 2/2] fixed c args and added node lockfile to .gitignore --- .gitignore | 1 + lxc/executors/c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 764c63f..5ef997d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ api/api +api/package-lock.json lxc/i lxc/lockfile diff --git a/lxc/executors/c b/lxc/executors/c index 096b1d9..719062a 100755 --- a/lxc/executors/c +++ b/lxc/executors/c @@ -1,5 +1,5 @@ #!/usr/bin/bash cd /tmp/$2 -gcc -std=c11 -o binary -x c code.code -timeout -s KILL 3 xargs -a args.args ./binary < stdin.stdin +timeout -s KILL 10 gcc -std=c11 -o binary -x c code.code +timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin