diff options
author | B Stack <bgstack15@gmail.com> | 2021-02-02 11:44:31 -0500 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2021-02-02 11:44:31 -0500 |
commit | d299ddd2f27a437f0fc0cb49abdfd6dd8e3d94f8 (patch) | |
tree | 4d7c950512836f473a6a8cbb521c61e800db6584 /zen/sys_version.cpp | |
parent | Merge branch '11.5' into 'master' (diff) | |
download | FreeFileSync-d299ddd2f27a437f0fc0cb49abdfd6dd8e3d94f8.tar.gz FreeFileSync-d299ddd2f27a437f0fc0cb49abdfd6dd8e3d94f8.tar.bz2 FreeFileSync-d299ddd2f27a437f0fc0cb49abdfd6dd8e3d94f8.zip |
add upstream 11.6
Diffstat (limited to 'zen/sys_version.cpp')
-rw-r--r-- | zen/sys_version.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/zen/sys_version.cpp b/zen/sys_version.cpp index d07bbc33..f7e4ffc8 100644 --- a/zen/sys_version.cpp +++ b/zen/sys_version.cpp @@ -7,7 +7,7 @@ #include "sys_version.h" #include <iostream> #include "file_io.h" - #include "shell_execute.h" + #include "process_exec.h" using namespace zen; @@ -25,15 +25,17 @@ OsVersionDetail zen::getOsVersionDetail() //throw SysError { if (const auto [exitCode, output] = consoleExecute("lsb_release --id -s", std::nullopt); //throw SysError exitCode != 0) - throw SysError(formatSystemError("lsb_release --id", replaceCpy(_("Exit code %x"), L"%x", numberTo<std::wstring>(exitCode)), output)); + throw SysError(formatSystemError("lsb_release --id", + replaceCpy(_("Exit code %x"), L"%x", numberTo<std::wstring>(exitCode)), utfTo<std::wstring>(output))); else - osName = trimCpy(output); + osName = utfTo<std::wstring>(trimCpy(output)); if (const auto [exitCode, output] = consoleExecute("lsb_release --release -s", std::nullopt); //throw SysError exitCode != 0) - throw SysError(formatSystemError("lsb_release --release", replaceCpy(_("Exit code %x"), L"%x", numberTo<std::wstring>(exitCode)), output)); + throw SysError(formatSystemError("lsb_release --release", + replaceCpy(_("Exit code %x"), L"%x", numberTo<std::wstring>(exitCode)), utfTo<std::wstring>(output))); else - osVersion = trimCpy(output); + osVersion = utfTo<std::wstring>(trimCpy(output)); } //lsb_release not available on some systems: https://freefilesync.org/forum/viewtopic.php?t=7191 catch (SysError&) // => fall back to /etc/os-release: https://www.freedesktop.org/software/systemd/man/os-release.html |