Fixes for duplicateStderr (I833aeb3a)
[lhc/web/wiklou.git] / includes / limit.sh
index 6c4690e..2a1545b 100644 (file)
@@ -6,6 +6,7 @@
 # and is available on most Linux systems. If Perl was distributed with
 # BSD::Resource included, we would happily use that instead, but it isn't.
 
+MW_INCLUDE_STDERR=
 MW_CPU_LIMIT=0
 MW_CGROUP=
 MW_MEM_LIMIT=0
@@ -15,6 +16,10 @@ MW_WALL_CLOCK_LIMIT=0
 # Override settings
 eval "$2"
 
+if [ -n "$MW_INCLUDE_STDERR" ]; then
+       exec 2>&1
+fi
+
 if [ "$MW_CPU_LIMIT" -gt 0 ]; then
        ulimit -t "$MW_CPU_LIMIT"
 fi