diff options
author | B Stack <bgstack15@gmail.com> | 2020-05-17 17:14:47 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-05-17 17:14:47 +0000 |
commit | cca3f71f16f85f5d506bf4bb7b3ec38fda31516a (patch) | |
tree | 1f52055b2f26fc2389d3ab4eb8d8d1e234a6316a /zen/shutdown.cpp | |
parent | Merge branch '10.23' into 'master' (diff) | |
parent | add upstream 10.24 (diff) | |
download | FreeFileSync-cca3f71f16f85f5d506bf4bb7b3ec38fda31516a.tar.gz FreeFileSync-cca3f71f16f85f5d506bf4bb7b3ec38fda31516a.tar.bz2 FreeFileSync-cca3f71f16f85f5d506bf4bb7b3ec38fda31516a.zip |
Merge branch '10.24' into 'master'
add upstream 10.24
See merge request opensource-tracking/FreeFileSync!21
Diffstat (limited to 'zen/shutdown.cpp')
-rw-r--r-- | zen/shutdown.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zen/shutdown.cpp b/zen/shutdown.cpp index 21e24527..8e8456df 100644 --- a/zen/shutdown.cpp +++ b/zen/shutdown.cpp @@ -19,7 +19,7 @@ void zen::shutdownSystem() //throw FileError { //https://linux.die.net/man/2/reboot => needs admin rights! //"systemctl" should work without admin rights: - const auto [exitCode, output] = consoleExecute("systemctl poweroff", std::nullopt /*timeoutMs*/); //throw SysError, (SysErrorTimeOut) + const auto& [exitCode, output] = consoleExecute("systemctl poweroff", std::nullopt /*timeoutMs*/); //throw SysError, (SysErrorTimeOut) if (!trimCpy(output).empty()) //see comment in suspendSystem() throw SysError(output); @@ -33,7 +33,7 @@ void zen::suspendSystem() //throw FileError try { //"systemctl" should work without admin rights: - const auto [exitCode, output] = consoleExecute("systemctl suspend", std::nullopt /*timeoutMs*/); //throw SysError, (SysErrorTimeOut) + const auto& [exitCode, output] = consoleExecute("systemctl suspend", std::nullopt /*timeoutMs*/); //throw SysError, (SysErrorTimeOut) //why does "systemctl suspend" return exit code 1 despite apparent success!?? if (!trimCpy(output).empty()) //at least we can assume "no output" on success throw SysError(output); |