From e71a5270a2fe040e0542bc2c74a11a303688f6ae Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Thu, 15 May 2008 19:10:26 -0400 Subject: Make sure that output files are always checked success before they're used. Make OutputDirectory::resolve() private and change the functions using resolve() to instead use create(). --HG-- extra : convert_revision : 36d4be629764d0c4c708cec8aa712cd15f966453 --- src/base/output.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/base/output.cc') diff --git a/src/base/output.cc b/src/base/output.cc index 9d02a4a71..5a1768a76 100644 --- a/src/base/output.cc +++ b/src/base/output.cc @@ -98,7 +98,7 @@ OutputDirectory::create(const string &name, bool binary) ofstream *file = new ofstream(resolve(name).c_str(), ios::trunc | binary ? ios::binary : (ios::openmode)0); if (!file->is_open()) - panic("Cannot open file %s", name); + fatal("Cannot open file %s", name); return file; } @@ -119,7 +119,7 @@ OutputDirectory::find(const string &name) ofstream *file = new ofstream(filename.c_str(), ios::trunc); if (!file->is_open()) - panic("Cannot open file %s", filename); + fatal("Cannot open file %s", filename); files[filename] = file; return file; -- cgit v1.2.3