Skip to content

Commit

Permalink
Merge pull request #10497 from degano/phystools_tmpnam_76X
Browse files Browse the repository at this point in the history
Fix warning raised by deprecated use of tmpnam.
  • Loading branch information
cmsbuild committed Aug 3, 2015
2 parents b8cc093 + 50abdc7 commit 1b8ed2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion PhysicsTools/MVAComputer/plugins/ProcTMVA.cc
Expand Up @@ -36,6 +36,8 @@
#include "PhysicsTools/MVAComputer/interface/mva_computer_define_plugin.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include <boost/filesystem.hpp>

using namespace PhysicsTools;

namespace { // anonymous
Expand Down Expand Up @@ -108,7 +110,7 @@ ProcTMVA::ProcTMVA(const char *name,
( reader->BookMVA( methodType, weight_text.c_str() ) ) );
} else {
// Write to a temporary file
TString weight_file_name(std::tmpnam(NULL));
TString weight_file_name(boost::filesystem::unique_path().c_str());
std::ofstream weight_file;
weight_file.open(weight_file_name.Data());
weight_file << weight_text;
Expand Down

0 comments on commit 1b8ed2f

Please sign in to comment.