From 338843ce46ee8ab78a1b3c60dcae0ec79a30aa28 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 19 Aug 2024 17:20:31 +0200 Subject: [PATCH] (FreeBSD) Added support for rebooting and powering off from inside ES-DE --- es-core/src/utils/PlatformUtil.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/es-core/src/utils/PlatformUtil.cpp b/es-core/src/utils/PlatformUtil.cpp index 27a145373..d3b63b2ac 100644 --- a/es-core/src/utils/PlatformUtil.cpp +++ b/es-core/src/utils/PlatformUtil.cpp @@ -43,8 +43,8 @@ namespace Utils { #if defined(_WIN64) return system("shutdown -r -t 0"); -#elif defined(__APPLE__) - // This will probably never be used as macOS requires root privileges to reboot. +#elif defined(__APPLE__) || defined(__FreeBSD__) + // This will probably never be used on macOS as it requires root privileges to reboot. return system("shutdown -r now"); #else return system("shutdown --reboot now"); @@ -58,6 +58,8 @@ namespace Utils #elif defined(__APPLE__) // This will probably never be used as macOS requires root privileges to power off. return system("shutdown now"); +#elif defined(__FreeBSD__) + return system("shutdown -p now"); #else return system("shutdown --poweroff now"); #endif