From 41f2282b2a80f772bf363e8127669377873627cb Mon Sep 17 00:00:00 2001 From: Harsh Sharma Date: Fri, 20 Dec 2019 12:12:05 -0600 Subject: Bug fix for writing device_info.json --- src/Device/Device.cpp | 10 ++++------ src/Version.cpp | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Device/Device.cpp b/src/Device/Device.cpp index 573e10b..bbfb189 100644 --- a/src/Device/Device.cpp +++ b/src/Device/Device.cpp @@ -410,13 +410,11 @@ void Device::writeJson() { rapidjson::StringBuffer buffer; rapidjson::Writer writer(buffer); deviceInfo.Accept(writer); - std::string json (buffer.GetString(), buffer.GetSize()); - std::ofstream of ("/var/run/config/device_info.json"); - of << json; - if (!of.good()) { - logError("Can't write to /var/run/config/device_info.json"); + std::ofstream os(DEVICE_INFO_FILE); + if (!os) { + logError("Can't write to " + std::string(DEVICE_INFO_FILE)); exitHandler(99); } else { - exitHandler(0); + os << buffer.GetString(); } } diff --git a/src/Version.cpp b/src/Version.cpp index 5585cc1..0786260 100644 --- a/src/Version.cpp +++ b/src/Version.cpp @@ -1,4 +1,4 @@ //Pre-Build Auto-Generated Source #include "Version.h" -const std::string Version::version("4.2.3-12-g42e11db"); +const std::string Version::version("v1.0.0"); -- cgit v1.2.3