aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2019-04-02 11:57:55 -0700
committerGitHub <noreply@github.com>2019-04-02 11:57:55 -0700
commit6adf37e3c1d4301e087d89c9e9c37563fe8d78df (patch)
tree60e5bcd1e58b0c756136d67ca93a29b2cc44a848
parent2e246c196895a3bb211278d9405e8ea7e886eaa9 (diff)
parent587b022b0ad40758233c31a3ec9b140f075c3e61 (diff)
downloadnextpnr-6adf37e3c1d4301e087d89c9e9c37563fe8d78df.tar.gz
nextpnr-6adf37e3c1d4301e087d89c9e9c37563fe8d78df.tar.bz2
nextpnr-6adf37e3c1d4301e087d89c9e9c37563fe8d78df.zip
Merge pull request #262 from chexum/gcc4x
common: avoid std::ofstream copy
-rw-r--r--common/command.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/command.cc b/common/command.cc
index 6f4137fe..49081e72 100644
--- a/common/command.cc
+++ b/common/command.cc
@@ -87,8 +87,8 @@ bool CommandHandler::executeBeforeContext()
if (vm.count("log")) {
std::string logfilename = vm["log"].as<std::string>();
- logfile = std::ofstream(logfilename);
- if (!logfile)
+ logfile.open(logfilename);
+ if (!logfile.is_open())
log_error("Failed to open log file '%s' for writing.\n", logfilename.c_str());
log_streams.push_back(std::make_pair(&logfile, LogLevel::LOG_MSG));
}