aboutsummaryrefslogtreecommitdiff
path: root/boca-1.5.1/doc/problemexamples/problemtemplate
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2012-09-14 13:40:18 +0000
committercassiopc <cassiopc@gmail.com>2012-09-14 13:40:18 +0000
commitea316c1c9bc7e019491635cc3c7a8a4b0eaec2db (patch)
treea41a3c70caf2aa44c03d34c07ea1062971253463 /boca-1.5.1/doc/problemexamples/problemtemplate
parent10dbedd7172c2164f5b3eb3f1c6e9b4081089e27 (diff)
downloadboca-ea316c1c9bc7e019491635cc3c7a8a4b0eaec2db.tar.gz
boca-ea316c1c9bc7e019491635cc3c7a8a4b0eaec2db.zip
fix bug on run/java when the code was not being chrooted (var java was not declared)
Diffstat (limited to 'boca-1.5.1/doc/problemexamples/problemtemplate')
-rwxr-xr-xboca-1.5.1/doc/problemexamples/problemtemplate/run/java8
1 files changed, 7 insertions, 1 deletions
diff --git a/boca-1.5.1/doc/problemexamples/problemtemplate/run/java b/boca-1.5.1/doc/problemexamples/problemtemplate/run/java
index d35818f..d6a73a5 100755
--- a/boca-1.5.1/doc/problemexamples/problemtemplate/run/java
+++ b/boca-1.5.1/doc/problemexamples/problemtemplate/run/java
@@ -15,7 +15,7 @@
# // You should have received a copy of the GNU General Public License
# // along with this program. If not, see <http://www.gnu.org/licenses/>.
# ////////////////////////////////////////////////////////////////////////////////
-#Last modified: 22/aug/2012 by cassio@ime.usp.br
+#Last modified: 14/sept/2012 by cassio@ime.usp.br
#
# parameters are:
# $1 main_class
@@ -164,6 +164,12 @@ else
echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2
echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2
echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2
+ java=`which java`
+ [ -x "$java" ] || java=/usr/bin/java
+ if [ ! -x $java ]; then
+ echo "$java not found or it's not executable"
+ exit 47
+ fi
$sf -r$nruns -t$time -T$ttime -istdin0 -F256 -u256 -U$bocau -G$bocag -ostdout0 -estderr0 -n0 -C. -d20000000 -m20000000 -- $java -cp run.jar -Xmx${maxm}K -Xms${maxm}K "$name"
ret=$?
fi