aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLAN-TW <lantw44@gmail.com>2012-10-15 12:02:36 +0800
committerLAN-TW <lantw44@gmail.com>2012-10-15 12:02:36 +0800
commit3b6bdf7d5388d393da4aef0be1047bada8e232ff (patch)
tree2fb1c36a3a16251f457bc7f5c0e090ad6aa7bf4f
parent77fd25c1a01c3a905e0ad1d27b6254d970380fe8 (diff)
downloadsctjudge-3b6bdf7d5388d393da4aef0be1047bada8e232ff.tar.gz
sctjudge-3b6bdf7d5388d393da4aef0be1047bada8e232ff.tar.zst
sctjudge-3b6bdf7d5388d393da4aef0be1047bada8e232ff.zip
配合命令列參數改變而做的修正
-rw-r--r--src/mkchild.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mkchild.c b/src/mkchild.c
index 063efc6..2876a92 100644
--- a/src/mkchild.c
+++ b/src/mkchild.c
@@ -227,13 +227,13 @@ static void sctjudge_list_settings(const struct makechildopt* mcopt){
printf("\t執行時間限制:%d 毫秒\n", mcopt->exectime);
fputs("\t記憶體使用量限制:", stdout);
if(mcopt->memlimit > 0){
- printf("%d MiB\n", mcopt->memlimit);
+ printf("%d 位元組\n", mcopt->memlimit);
}else{
puts("無限制");
}
fputs("\t輸出限制:", stdout);
if(mcopt->outlimit > 0){
- printf("%d MiB\n", mcopt->outlimit);
+ printf("%d 位元組\n", mcopt->outlimit);
}else{
puts("無限制");
}
@@ -625,7 +625,7 @@ void* sctjudge_makechild(void* arg){
/* 開始設定資源限制 */
if(mcopt.memlimit > 0){
- childressize = mcopt.memlimit * 1024 * 1024;
+ childressize = mcopt.memlimit;
childres.rlim_cur = childressize;
childres.rlim_max = childressize;
if(setrlimit(RLIMIT_AS, &childres) < 0){
@@ -637,7 +637,7 @@ void* sctjudge_makechild(void* arg){
}
if(mcopt.outlimit > 0){
- childressize = mcopt.outlimit * 1024 * 1024;
+ childressize = mcopt.outlimit;
childres.rlim_cur = childressize;
childres.rlim_max = childressize;
if(setrlimit(RLIMIT_FSIZE, &childres) < 0){