diff options
Diffstat (limited to 'zen/sys_info.cpp')
-rw-r--r-- | zen/sys_info.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/zen/sys_info.cpp b/zen/sys_info.cpp index 55465711..2a32d247 100644 --- a/zen/sys_info.cpp +++ b/zen/sys_info.cpp @@ -131,8 +131,8 @@ ComputerModel zen::getComputerModel() //throw FileError cm.model = beforeFirst(cm.model, L'\u00ff', IfNotFoundReturn::all); //fix broken BIOS entries: cm.vendor = beforeFirst(cm.vendor, L'\u00ff', IfNotFoundReturn::all); //0xff can be considered 0 - trim(cm.model, false, true, [](wchar_t c) { return c == L'_'; }); //e.g. "CBX3___" or just "_" - trim(cm.vendor, false, true, [](wchar_t c) { return c == L'_'; }); //e.g. "DELL__" or just "_" + trim(cm.model, TrimSide::right, [](wchar_t c) { return c == L'_'; }); //e.g. "CBX3___" or just "_" + trim(cm.vendor, TrimSide::right, [](wchar_t c) { return c == L'_'; }); //e.g. "DELL__" or just "_" for (const char* dummyModel : { @@ -209,9 +209,13 @@ std::wstring zen::getOsDescription() //throw FileError Zstring zen::getRealProcessPath() //throw FileError { - return getSymlinkRawContent("/proc/self/exe").targetPath; //throw FileError - //path does not contain symlinks => no need for ::realpath() + try + { + return getSymlinkRawContent_impl("/proc/self/exe").targetPath; //throw SysError + //path does not contain symlinks => no need for ::realpath() + } + catch (const SysError& e) { throw FileError(_("Cannot get process information."), e.toString()); } } |