From 2bc28d47cd43bf6b8fef4059b59964073c0146bc Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Mon, 11 Aug 2025 08:31:30 +0200 Subject: [PATCH] fix shutdown.cpp per a macos (altra volta) --- source/shutdown.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/source/shutdown.cpp b/source/shutdown.cpp index 5f3e163..c7804c0 100644 --- a/source/shutdown.cpp +++ b/source/shutdown.cpp @@ -91,33 +91,22 @@ namespace SystemShutdown { } #elif __APPLE__ - // macOS - double delay_minutes = config.delay_seconds / 60.0; - std::string delay_str = "+" + std::to_string(delay_minutes); - if (config.delay_seconds < 60) { - delay_str = "+0.1"; // mínimo delay en macOS - } - + // macOS - apagado inmediato char* args[] = { const_cast("shutdown"), const_cast("-h"), - const_cast(delay_str.c_str()), + const_cast("now"), NULL }; return executeUnixShutdown("shutdown", args); #elif __linux__ - // Linux - std::string delay_str = "+" + std::to_string((config.delay_seconds + 59) / 60); // redondear hacia arriba a minutos - if (config.delay_seconds == 0) { - delay_str = "now"; - } - + // Linux - apagado inmediato char* args[] = { const_cast("shutdown"), const_cast("-h"), - const_cast(delay_str.c_str()), + const_cast("now"), NULL };