Axel Belinfante [Fri, 28 Sep 2012 15:11:46 +0000 (17:11 +0200)]
this seems better than using a percentage for the limit difference

linux.c

diff --git a/linux.c b/linux.c
index ecc3b08..644e2e7 100644 (file)
--- a/linux.c
+++ b/linux.c
@@ -123,7 +123,7 @@ int set_mem_limit(unsigned long maxbytes)
 int set_cpu_limit(unsigned long maxseconds)
 {
        struct  rlimit rl;
-       long int hardlimit=(long int)maxseconds*1.05;
+       unsigned long int hardlimit=maxseconds+2;
        rl.rlim_cur=maxseconds; 
        rl.rlim_max=hardlimit;
        return setrlimit(RLIMIT_CPU,&rl);