From 0a1613abe1d5ec9353001d68d6bb44bc64d97244 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Thu, 2 Oct 2008 12:46:57 -0400 Subject: Output: Verify output files are open after opening them. --- src/sim/serialize.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/sim/serialize.cc') diff --git a/src/sim/serialize.cc b/src/sim/serialize.cc index 7050779b2..a4851d3f6 100644 --- a/src/sim/serialize.cc +++ b/src/sim/serialize.cc @@ -405,6 +405,8 @@ Serializable::serializeAll(const std::string &cpt_dir) string cpt_file = dir + Checkpoint::baseFilename; ofstream outstream(cpt_file.c_str()); time_t t = time(NULL); + if (!outstream.is_open()) + fatal("Unable to open file %s for writing\n", cpt_file.c_str()); outstream << "// checkpoint generated: " << ctime(&t); globals.serialize(outstream); -- cgit v1.2.3