From 406a410bc3b4f245803dec59c1ee4a72aa10e313 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 25 Jun 2007 10:31:37 +0300 Subject: Don't mmap large files (rhbz#139539, 177616) Patch from Thomas Woerner --- rpmdb/legacy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rpmdb/legacy.c b/rpmdb/legacy.c index b97d67b70..3968369e2 100644 --- a/rpmdb/legacy.c +++ b/rpmdb/legacy.c @@ -167,6 +167,11 @@ int domd5(const char * fn, unsigned char * digest, int asAscii, size_t *fsizep) goto exit; } + /* file to large (32 MB), do not mmap file */ + if (fsize > (size_t) 32*1024*1024) + if (ut == URL_IS_PATH || ut == URL_IS_UNKNOWN) + ut = URL_IS_DASH; /* force fd io */ + switch(ut) { case URL_IS_PATH: case URL_IS_UNKNOWN: -- cgit v1.2.3