From 9f99c35b58a9aea741f39450e2681b30bd99522a Mon Sep 17 00:00:00 2001
From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de>
Date: Thu, 31 Aug 2017 17:23:52 +0200
Subject: [PATCH] Fixups to the new TSC frequency getter method

---
 dune/perftool/common/tsc.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dune/perftool/common/tsc.cc b/dune/perftool/common/tsc.cc
index 999eee11..42616419 100644
--- a/dune/perftool/common/tsc.cc
+++ b/dune/perftool/common/tsc.cc
@@ -1,6 +1,7 @@
 #include "config.h"
 
 #include <regex>
+#include <fstream>
 #include <iostream>
 #include <algorithm>
 #include <vector>
@@ -113,13 +114,14 @@ namespace Dune {
       {
         double result = -1.0;
         try {
-          auto cpuinfo = std::ifstream("/proc/cpuinfo");
+          std::ifstream cpuinfo("/proc/cpuinfo");
           auto re = std::regex("bogomips\\s:\\s(\\d+\\.\\d+)$");
 
+          auto match = std::smatch();
           using std::getline;
           for (std::string line ; getline(cpuinfo,line) ; )
           {
-            if (auto match = std::smatch() ; std::regex_match(line,match,re))
+            if (std::regex_match(line,match,re))
             {
               result = 5e5 * std::stod(match[1].str());
               break;
-- 
GitLab