[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b
aCaB
acab at clamav.net
Sun Apr 4 00:59:58 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit c124d71a696aad2be2c06c064aa2352304feaa27
Author: aCaB <acab at clamav.net>
Date: Thu Aug 20 02:19:57 2009 +0200
fmunmap
diff --git a/libclamav/fmap.c b/libclamav/fmap.c
index 0c9e06e..def0f13 100644
--- a/libclamav/fmap.c
+++ b/libclamav/fmap.c
@@ -24,16 +24,19 @@
#include "clamav-config.h"
#endif
+/* THIS IS FUCKED UP AND BREAKS MMAP
+#define _XOPEN_SOURCE 500
+*/
+
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
-#include <sys/mman.h>
#include <unistd.h>
+#include <sys/mman.h>
#include "others.h"
#include "cltypes.h"
-
#define FM_MASK_SCORE 0x3fff
#define FM_MASK_PAGED 0x4000
#define FM_MASK_SEEN 0x8000
@@ -171,3 +174,9 @@ void *fmap_need(struct F_MAP *m, size_t at, size_t len) {
return (void *)ret;
}
+
+void fmunmap(struct F_MAP *m) {
+ void *p = (void *)m;
+ size_t len = m->pages * m->pgsz + m->hdrsz;
+ munmap(p, len);
+}
diff --git a/libclamav/fmap.h b/libclamav/fmap.h
index a624ed3..84a49b8 100644
--- a/libclamav/fmap.h
+++ b/libclamav/fmap.h
@@ -18,8 +18,12 @@
* MA 02110-1301, USA.
*/
+#ifndef __FMAP_H
+#define __FMAP_H
struct F_MAP;
struct F_MAP *fmap(int fd, off_t offset, size_t len);
+void *fmunmap(struct F_MAP *m, size_t len);
+#endif
--
Debian repository for ClamAV
More information about the Pkg-clamav-commits
mailing list