summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/mmap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib/mmap.cc')
-rw-r--r--apt-pkg/contrib/mmap.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
index f8582a1ef..e12e077c6 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: mmap.cc,v 1.7 1998/07/19 04:42:14 jgg Exp $
+// $Id: mmap.cc,v 1.8 1998/07/26 04:49:34 jgg Exp $
/* ######################################################################
MMap Class - Provides 'real' mmap or a faked mmap using read().
@@ -69,6 +69,9 @@ bool MMap::Map()
if ((Flags & Public) != Public)
Map = MAP_PRIVATE;
+ if (iSize == 0)
+ return _error->Error("Can't mmap an empty file");
+
// Map it.
Base = mmap(0,iSize,Prot,Map,Fd.Fd(),0);
if (Base == (void *)-1)