#define METHOD_HAPTIC_SHOWHANDLELIST "ShowHandleList"
#define METHOD_HAPTIC_ISSUPPORTED "IsSupported"
-static bool request_haptic_method(const char *method, GVariant *param, int *return_val)
+static bool request_haptic_method(const char *method, GVariant *param, int *out_val)
{
- GVariant *msg;
- int val, err;
+ GVariant *reply;
+ int reply_val, ret_dbus;
bool ret = FALSE;
- err = dbus_handle_method_sync_with_reply_var(VIBRATOR_BUS_NAME,
+ ret_dbus = dbus_handle_method_sync_with_reply_var(VIBRATOR_BUS_NAME,
VIBRATOR_PATH_HAPTIC,
VIBRATOR_INTERFACE_HAPTIC,
- method, param, &msg);
+ method, param, &reply);
- if (err < 0) {
+ if (ret_dbus < 0) {
_E("Failed to call %s: no reply", method);
return ret;
}
- if (!g_variant_get_safe(msg, "(i)", &val))
+ if (!g_variant_get_safe(reply, "(i)", &reply_val))
_E("Failed to call %s: no message", method);
else {
- if ((val == -ENOTSUP) || (val == -ENOSYS)) {
- _I("Not supported feature(%s): %d", method, val);
+ if ((reply_val == -ENOTSUP) || (reply_val == -ENOSYS)) {
+ _I("Not supported feature(%s): %d", method, reply_val);
ret = TRUE;
- } else if (val == -ENODEV) {
- _E("Failed to call %s. Device open fail: %d", method, val);
- } else if (val < 0) {
- _E("Failed to call %s. Returned fail: %d", method, val);
+ } else if (reply_val == -ENODEV) {
+ _E("Failed to call %s. Device open fail: %d", method, reply_val);
+ } else if (reply_val < 0) {
+ _E("Failed to call %s. Returned fail: %d", method, reply_val);
} else {
- _I("Success. %s: %d", method, val);
+ _I("Success. %s: %d", method, reply_val);
ret = TRUE;
}
}
- g_variant_unref(msg);
+ g_variant_unref(reply);
- if (return_val)
- *return_val = val;
+ if (out_val)
+ *out_val = reply_val;
return ret;
}