diff options
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r-- | apt-pkg/contrib/mmap.cc | 5 | ||||
-rw-r--r-- | apt-pkg/contrib/progress.cc | 9 |
2 files changed, 10 insertions, 4 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) diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc index 8d49eff2e..aa5acf010 100644 --- a/apt-pkg/contrib/progress.cc +++ b/apt-pkg/contrib/progress.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: progress.cc,v 1.2 1998/07/22 01:45:38 jgg Exp $ +// $Id: progress.cc,v 1.3 1998/07/26 04:49:35 jgg Exp $ /* ###################################################################### OpProgress - Operation Progress @@ -97,7 +97,10 @@ void OpTextProgress::Done() if (NoUpdate == false && OldOp.empty() == false) { char S[300]; - snprintf(S,sizeof(S),"\r%s... Done",OldOp.c_str()); + if (_errors->PendingError() == true) + snprintf(S,sizeof(S),"\r%s... Error!",OldOp.c_str()); + else + snprintf(S,sizeof(S),"\r%s... Done",OldOp.c_str()); Write(S); cout << endl; OldOp = string(); @@ -109,7 +112,7 @@ void OpTextProgress::Done() /* */ void OpTextProgress::Update() { - if (CheckChange(0) == false) + if (CheckChange() == false) return; // No percent spinner |