From f0f3f094c5fa05bafe1963d1ea13f1be39a6673b Mon Sep 17 00:00:00 2001 From: B Stack Date: Sun, 17 May 2020 11:17:28 -0400 Subject: add upstream 10.24 --- zen/shutdown.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'zen/shutdown.cpp') 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); -- cgit