summaryrefslogtreecommitdiff
path: root/zen/shutdown.cpp
diff options
context:
space:
mode:
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