| Matt Spinler | df13bdb | 2019-07-10 16:54:13 -0500 | [diff] [blame] | 1 | #include "extensions/openpower-pels/paths.hpp" |
| 2 | |||||
| 3 | #include <filesystem> | ||||
| 4 | |||||
| 5 | namespace openpower | ||||
| 6 | { | ||||
| 7 | namespace pels | ||||
| 8 | { | ||||
| 9 | |||||
| 10 | // Use paths that work in unit tests. | ||||
| 11 | |||||
| 12 | std::filesystem::path getPELIDFile() | ||||
| 13 | { | ||||
| 14 | static std::string idFile; | ||||
| 15 | |||||
| 16 | if (idFile.empty()) | ||||
| 17 | { | ||||
| 18 | char templ[] = "/tmp/logidtestXXXXXX"; | ||||
| 19 | std::filesystem::path dir = mkdtemp(templ); | ||||
| 20 | idFile = dir / "logid"; | ||||
| 21 | } | ||||
| 22 | return idFile; | ||||
| 23 | } | ||||
| 24 | |||||
| 25 | } // namespace pels | ||||
| 26 | } // namespace openpower | ||||