summaryrefslogtreecommitdiff
path: root/zen/shutdown.cpp
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-05-17 17:14:47 +0000
committerB Stack <bgstack15@gmail.com>2020-05-17 17:14:47 +0000
commitcca3f71f16f85f5d506bf4bb7b3ec38fda31516a (patch)
tree1f52055b2f26fc2389d3ab4eb8d8d1e234a6316a /zen/shutdown.cpp
parentMerge branch '10.23' into 'master' (diff)
parentadd upstream 10.24 (diff)
downloadFreeFileSync-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.cpp4
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);
bgstack15