diff options
author | B Stack <bgstack15@gmail.com> | 2020-05-17 11:17:28 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-05-17 11:17:28 -0400 |
commit | f0f3f094c5fa05bafe1963d1ea13f1be39a6673b (patch) | |
tree | 1f52055b2f26fc2389d3ab4eb8d8d1e234a6316a /zen/shutdown.cpp | |
parent | Merge branch '10.23' into 'master' (diff) | |
download | FreeFileSync-f0f3f094c5fa05bafe1963d1ea13f1be39a6673b.tar.gz FreeFileSync-f0f3f094c5fa05bafe1963d1ea13f1be39a6673b.tar.bz2 FreeFileSync-f0f3f094c5fa05bafe1963d1ea13f1be39a6673b.zip |
add upstream 10.24
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); |