summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/mmap.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:50:54 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:50:54 +0000
commitb35d2f5fa0e797bf7062a1a7448a5d54bb396071 (patch)
treef87dc91079639f2a250b8901265ef35e4517cf5a /apt-pkg/contrib/mmap.cc
parentf1148902de0b269467d445554f5d860513e39871 (diff)
Progress and combined cache generator
Author: jgg Date: 1998-07-26 04:49:26 GMT Progress and combined cache generator
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)