summaryrefslogtreecommitdiff
path: root/sim/serialize.cc
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-09-18 21:20:24 -0400
committerNathan Binkert <binkertn@umich.edu>2005-09-18 21:20:24 -0400
commitb1a1566818777acde37ae3dbf5ffea9ddca2d4a0 (patch)
treeada9753a194e745fe42db7c54c4b13ff795b03cf /sim/serialize.cc
parent02098f8e7b7f13181b41606d8cc3f0d9bd611e65 (diff)
downloadgem5-b1a1566818777acde37ae3dbf5ffea9ddca2d4a0.tar.xz
fix the MAX_CHECKPOINTS stuff
sim/serialize.cc: Make the max checkpoint thing actually stop after the last checkpoint --HG-- extra : convert_revision : 091179c4706e9876a9b7e826513c5c14ce6b72af
Diffstat (limited to 'sim/serialize.cc')
-rw-r--r--sim/serialize.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sim/serialize.cc b/sim/serialize.cc
index dd5d53642..ec7241498 100644
--- a/sim/serialize.cc
+++ b/sim/serialize.cc
@@ -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");
}