fix the MAX_CHECKPOINTS stuff
sim/serialize.cc: Make the max checkpoint thing actually stop after the last checkpoint --HG-- extra : convert_revision : 091179c4706e9876a9b7e826513c5c14ce6b72af
This commit is contained in:
parent
02098f8e7b
commit
b1a1566818
1 changed files with 5 additions and 5 deletions
|
@ -51,8 +51,8 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
int Serializable::maxCount;
|
||||
int Serializable::count;
|
||||
int Serializable::maxCount = 0;
|
||||
int Serializable::count = 0;
|
||||
|
||||
void
|
||||
Serializable::nameOut(ostream &os)
|
||||
|
@ -229,9 +229,6 @@ Globals::unserialize(Checkpoint *cp)
|
|||
void
|
||||
Serializable::serializeAll()
|
||||
{
|
||||
if (maxCount && count++ > maxCount)
|
||||
exitNow("Maximum number of checkpoints dropped", 0);
|
||||
|
||||
string dir = Checkpoint::dir();
|
||||
if (mkdir(dir.c_str(), 0775) == -1 && errno != EEXIST)
|
||||
fatal("couldn't mkdir %s\n", dir);
|
||||
|
@ -243,6 +240,9 @@ Serializable::serializeAll()
|
|||
|
||||
globals.serialize(outstream);
|
||||
SimObject::serializeAll(outstream);
|
||||
|
||||
if (maxCount && ++count >= maxCount)
|
||||
SimExit(curTick + 1, "Maximum number of checkpoints dropped");
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue