1
0
Fork 0
mirror of https://github.com/engineer-man/piston.git synced 2025-05-14 07:36:28 +02:00

Fix stdin for most languages

This commit is contained in:
Vrganj 2021-01-17 00:54:57 +00:00
parent b7ba08ccdf
commit 008d55643b
26 changed files with 172 additions and 103 deletions
lxc/executors

View file

@ -1,7 +1,8 @@
cd /tmp/$2
mv code.code code.hs
#!/bin/bash
runuser runner$1 -c "\
cd /tmp/$2 ; \
ghc -dynamic -o binary code.hs > /dev/null 2>&1 ; \
cat args.args | xargs -d '\n' timeout -s KILL 3 ./binary < stdin.stdin"
cd /tmp/$2
cp code.code code.hs
ghc -dynamic -o binary code.hs > /dev/null 2>&1
timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin
"