From 2df29bde3412dff8a412efde1c44da5b62f92bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B6r=C3=B6k=20Edvin?= Date: Fri, 10 Jun 2011 20:17:19 +0300 Subject: [PATCH] mbox already fmapified, just drop descriptor --- libclamav/mbox.c | 8 ++++---- libclamav/mbox.h | 2 +- libclamav/scanners.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libclamav/mbox.c b/libclamav/mbox.c index c2f95e268..8aa52419a 100644 --- a/libclamav/mbox.c +++ b/libclamav/mbox.c @@ -186,7 +186,7 @@ typedef struct mbox_ctx { #define UNLOCKFILE(fp) #endif -static int cli_parse_mbox(const char *dir, int desc, cli_ctx *ctx); +static int cli_parse_mbox(const char *dir, cli_ctx *ctx); static message *parseEmailFile(fmap_t *map, size_t *at, const table_t *rfc821Table, const char *firstLine, const char *dir); static message *parseEmailHeaders(message *m, const table_t *rfc821Table); static int parseEmailHeader(message *m, const char *line, const table_t *rfc821Table); @@ -302,13 +302,13 @@ static pthread_mutex_t tables_mutex = PTHREAD_MUTEX_INITIALIZER; #endif int -cli_mbox(const char *dir, int desc, cli_ctx *ctx) +cli_mbox(const char *dir, cli_ctx *ctx) { if(dir == NULL) { cli_dbgmsg("cli_mbox called with NULL dir\n"); return CL_ENULLARG; } - return cli_parse_mbox(dir, desc, ctx); + return cli_parse_mbox(dir, ctx); } /* @@ -327,7 +327,7 @@ cli_mbox(const char *dir, int desc, cli_ctx *ctx) * e.g. \0Content-Type: application/binary; */ static int -cli_parse_mbox(const char *dir, int desc, cli_ctx *ctx) +cli_parse_mbox(const char *dir, cli_ctx *ctx) { int retcode; message *body; diff --git a/libclamav/mbox.h b/libclamav/mbox.h index 326969576..0a6f28faf 100644 --- a/libclamav/mbox.h +++ b/libclamav/mbox.h @@ -50,6 +50,6 @@ typedef enum { #include "uuencode.h" size_t strstrip(char *s); /* remove trailing white space */ -int cli_mbox(const char *dir, int desc, cli_ctx *ctx); +int cli_mbox(const char *dir, cli_ctx *ctx); #endif /* __MBOX_H */ diff --git a/libclamav/scanners.c b/libclamav/scanners.c index d03c95e7d..d9d270c93 100644 --- a/libclamav/scanners.c +++ b/libclamav/scanners.c @@ -1531,7 +1531,7 @@ static int cli_scanuuencoded(cli_ctx *ctx) return ret; } -static int cli_scanmail(int desc, cli_ctx *ctx) +static int cli_scanmail(cli_ctx *ctx) { char *dir; int ret; @@ -1552,7 +1552,7 @@ static int cli_scanmail(int desc, cli_ctx *ctx) /* * Extract the attachments into the temporary directory */ - if((ret = cli_mbox(dir, desc, ctx))) { + if((ret = cli_mbox(dir, ctx))) { if(!ctx->engine->keeptmp) cli_rmdirs(dir); free(dir); @@ -2022,7 +2022,7 @@ static int cli_scanraw(cli_ctx *ctx, cli_file_t type, uint8_t typercg, cli_file_ ctx->container_size = map->len; if(SCAN_MAIL && type == CL_TYPE_TEXT_ASCII && (DCONF_MAIL & MAIL_CONF_MBOX)) { *dettype = CL_TYPE_MAIL; - nret = cli_scanmail(map->fd, ctx); + nret = cli_scanmail(ctx); } ctx->container_type = current_container_type; ctx->container_size = current_container_size; @@ -2341,7 +2341,7 @@ static int magic_scandesc(int desc, cli_ctx *ctx, cli_file_t type) ctx->container_type = CL_TYPE_MAIL; ctx->container_size = sb.st_size; if(SCAN_MAIL && (DCONF_MAIL & MAIL_CONF_MBOX)) - ret = cli_scanmail(desc, ctx); + ret = cli_scanmail(ctx); break; case CL_TYPE_TNEF: