MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / shutdown_logind

Function shutdown_logind

gtk/src/callbacks.c:232–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232static void
233shutdown_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
267static guint suspend_cookie = 0;
268

Callers 1

shutdown_cbFunction · 0.85

Calls 1

ghb_get_dbus_proxyFunction · 0.85

Tested by

no test coverage detected