static int power_suspend(char **args)
{
- gdbus_call_sync_with_reply(DEVICED_BUS_NAME,
+ int ret;
+ ret = gdbus_call_sync_with_reply(DEVICED_BUS_NAME,
DEVICED_PATH_POWER,
DEVICED_INTERFACE_POWER,
"PowerChangeStateWithReason",
g_variant_new("(ti)", DEVICED_POWER_STATE_SLEEP, atoi(args[3])),
NULL);
+ if (ret < 0) {
+ _E("Failed to call dbus method PowerChangeStateWithReason");
+ return ret;
+ }
+
return 0;
}
static int power_resume(char **args)
{
- gdbus_call_sync_with_reply(DEVICED_BUS_NAME,
+ int ret;
+ ret = gdbus_call_sync_with_reply(DEVICED_BUS_NAME,
DEVICED_PATH_POWER,
DEVICED_INTERFACE_POWER,
"PowerChangeStateWithReason",
g_variant_new("(ti)", DEVICED_POWER_STATE_NORMAL, atoi(args[3])),
NULL);
+ if (ret < 0) {
+ _E("Failed to call dbus method PowerChangeStateWithReason");
+ return ret;
+ }
+
return 0;
}