fix clamav-config include, properly restore fmap - thx edwin for the spot!

0.96
aCaB 16 years ago
parent 2ca732e206
commit 60b2125135
  1. 8
      libclamav/cache.c
  2. 6
      libclamav/scanners.c

@ -2,16 +2,16 @@
#include <stdlib.h>
#include <pthread.h>
#if HAVE_CONFIG_H
#include "clamav-config.h"
#endif
#include "md5.h"
#include "mpool.h"
#include "clamav.h"
#include "cache.h"
#include "fmap.h"
#if HAVE_CONFIG_H
#include "clamav-config.h"
#endif
#define CACHE_PERTURB 10
/* 1/10th */

@ -1874,11 +1874,15 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
ctx->fmap++;
if(!(*ctx->fmap = fmap(desc, 0, sb.st_size))) {
cli_errmsg("CRITICAL: fmap() failed\n");
ctx->fmap--;
return CL_EMEM;
}
if(cache_check(hash, ctx) == CL_CLEAN)
if(cache_check(hash, ctx) == CL_CLEAN) {
funmap(*ctx->fmap);
ctx->fmap--;
return CL_CLEAN;
}
if(!ctx->options || (ctx->recursion == ctx->engine->maxreclevel)) { /* raw mode (stdin, etc.) or last level of recursion */
if(ctx->recursion == ctx->engine->maxreclevel)

Loading…
Cancel
Save