Browse code

clamscan/manager.c: check rlim_cur instead of rlim_max

git-svn: trunk@5006

Tomasz Kojm authored on 2009/04/02 19:46:32
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Apr  2 12:45:52 CEST 2009 (tk)
2
+----------------------------------
3
+ * clamscan/manager.c: check rlim_cur instead of rlim_max
4
+
1 5
 Wed Apr  1 23:02:59 CEST 2009 (tk)
2 6
 ----------------------------------
3 7
  * freshclam/freshclam.c: fix verbose mode (bb#1510)
... ...
@@ -470,9 +470,9 @@ int scanmanager(const struct optstruct *opts)
470 470
 
471 471
 #ifndef C_WINDOWS
472 472
     if(getrlimit(RLIMIT_FSIZE, &rlim) == 0) {
473
-	if(rlim.rlim_max < (rlim_t) cl_engine_get_num(engine, CL_ENGINE_MAX_FILESIZE, NULL))
473
+	if(rlim.rlim_cur < (rlim_t) cl_engine_get_num(engine, CL_ENGINE_MAX_FILESIZE, NULL))
474 474
 	    logg("^System limit for file size is lower than engine->maxfilesize\n");
475
-	if(rlim.rlim_max < (rlim_t) cl_engine_get_num(engine, CL_ENGINE_MAX_SCANSIZE, NULL))
475
+	if(rlim.rlim_cur < (rlim_t) cl_engine_get_num(engine, CL_ENGINE_MAX_SCANSIZE, NULL))
476 476
 	    logg("^System limit for file size is lower than engine->maxscansize\n");
477 477
     } else {
478 478
 	logg("^Cannot obtain resource limits for file size\n");