Skip to content

Commit

Permalink
Merge branch 'hotfix/fixBuild'
Browse files Browse the repository at this point in the history
  • Loading branch information
sgallou committed Sep 28, 2022
2 parents 54bc49b + ef33925 commit 41a933c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions sources/server/tools/linux/tools/OperatingSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ namespace tools
{
sync();
auto rc = system(andRestart ? "shutdown --reboot now" : "shutdown --poweroff now");
if (retValue == -1 || WEXITSTATUS(retValue) != 0)
if (rc == -1 || WEXITSTATUS(rc) != 0)
{
auto errorMsg = strerror(rc);
YADOMS_LOG(warning) << "Error when try to shutdown/reboot : " << errorMsg << ", try with sudo...";
YADOMS_LOG(warning) << "Error when try to shutdown/reboot : " << strerror(rc) << ", try with sudo...";

rc = system(andRestart ? "sudo shutdown --reboot now" : "sudo shutdown --poweroff now");
if (retValue == -1 || WEXITSTATUS(retValue) != 0)
if (rc == -1 || WEXITSTATUS(rc) != 0)
{
auto errorMsg = strerror(rc);
YADOMS_LOG(error) << "Error when try to shutdown/reboot (with sudo) : " << errorMsg;
YADOMS_LOG(error) << "Error when try to shutdown/reboot (with sudo) : " << strerror(rc);
return false;
}

Expand Down

0 comments on commit 41a933c

Please sign in to comment.