| 230 | } |
| 231 | |
| 232 | static void |
| 233 | shutdown_logind (void) |
| 234 | { |
| 235 | #if !defined(_WIN32) |
| 236 | GDBusProxy *proxy; |
| 237 | GError *error = NULL; |
| 238 | GVariant *res; |
| 239 | |
| 240 | |
| 241 | ghb_log_func(); |
| 242 | proxy = ghb_get_dbus_proxy(G_BUS_TYPE_SYSTEM, DBUS_LOGIND_SERVICE, |
| 243 | DBUS_LOGIND_PATH, DBUS_LOGIND_INTERFACE); |
| 244 | if (proxy == NULL) |
| 245 | return; |
| 246 | |
| 247 | res = g_dbus_proxy_call_sync(proxy, "PowerOff", g_variant_new("(b)", FALSE), |
| 248 | G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error); |
| 249 | if (!res) |
| 250 | { |
| 251 | if (error != NULL) |
| 252 | { |
| 253 | g_warning("PowerOff failed: %s", error->message); |
| 254 | g_error_free(error); |
| 255 | } |
| 256 | else |
| 257 | g_warning("PowerOff failed"); |
| 258 | } |
| 259 | else |
| 260 | { |
| 261 | g_variant_unref(res); |
| 262 | } |
| 263 | g_object_unref(G_OBJECT(proxy)); |
| 264 | #endif |
| 265 | } |
| 266 | |
| 267 | static guint suspend_cookie = 0; |
| 268 |
no test coverage detected