Skip to content
Snippets Groups Projects
Commit 99c8a2b7 authored by Simon McVittie's avatar Simon McVittie
Browse files

launcher: Use G_DBUS_METHOD_INVOCATION_HANDLED for improved clarity


I added this to GLib at the beginning of the 2.68 cycle.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 72176a47
No related branches found
No related tags found
1 merge request!162Preparation for input device interface
...@@ -284,14 +284,14 @@ handle_launch (PvLauncher1 *object, ...@@ -284,14 +284,14 @@ handle_launch (PvLauncher1 *object,
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_INVALID_ARGS, G_DBUS_ERROR_INVALID_ARGS,
"No command given"); "No command given");
return TRUE; return G_DBUS_METHOD_INVOCATION_HANDLED;
} }
if ((arg_flags & ~PV_LAUNCH_FLAGS_MASK) != 0) if ((arg_flags & ~PV_LAUNCH_FLAGS_MASK) != 0)
{ {
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS,
"Unsupported flags enabled: 0x%x", arg_flags & ~PV_LAUNCH_FLAGS_MASK); "Unsupported flags enabled: 0x%x", arg_flags & ~PV_LAUNCH_FLAGS_MASK);
return TRUE; return G_DBUS_METHOD_INVOCATION_HANDLED;
} }
g_variant_lookup (arg_options, "terminate-after", "b", &terminate_after); g_variant_lookup (arg_options, "terminate-after", "b", &terminate_after);
...@@ -449,7 +449,7 @@ handle_launch (PvLauncher1 *object, ...@@ -449,7 +449,7 @@ handle_launch (PvLauncher1 *object,
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, code, g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, code,
"Failed to start command: %s", "Failed to start command: %s",
error->message); error->message);
return TRUE; return G_DBUS_METHOD_INVOCATION_HANDLED;
} }
pid_data = g_new0 (PidData, 1); pid_data = g_new0 (PidData, 1);
...@@ -469,7 +469,7 @@ handle_launch (PvLauncher1 *object, ...@@ -469,7 +469,7 @@ handle_launch (PvLauncher1 *object,
pid_data); pid_data);
pv_launcher1_complete_launch (object, invocation, NULL, pid); pv_launcher1_complete_launch (object, invocation, NULL, pid);
return TRUE; return G_DBUS_METHOD_INVOCATION_HANDLED;
} }
static gboolean static gboolean
...@@ -491,7 +491,7 @@ handle_send_signal (PvLauncher1 *object, ...@@ -491,7 +491,7 @@ handle_send_signal (PvLauncher1 *object,
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN, G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN,
"No such pid"); "No such pid");
return TRUE; return G_DBUS_METHOD_INVOCATION_HANDLED;
} }
g_debug ("Sending signal %d to client pid %d", arg_signal, arg_pid); g_debug ("Sending signal %d to client pid %d", arg_signal, arg_pid);
...@@ -503,7 +503,7 @@ handle_send_signal (PvLauncher1 *object, ...@@ -503,7 +503,7 @@ handle_send_signal (PvLauncher1 *object,
pv_launcher1_complete_send_signal (launcher, invocation); pv_launcher1_complete_send_signal (launcher, invocation);
return TRUE; return G_DBUS_METHOD_INVOCATION_HANDLED;
} }
static gboolean static gboolean
...@@ -513,7 +513,7 @@ handle_terminate (PvLauncher1 *object, ...@@ -513,7 +513,7 @@ handle_terminate (PvLauncher1 *object,
terminate_children (SIGTERM); terminate_children (SIGTERM);
pv_launcher1_complete_terminate (object, invocation); pv_launcher1_complete_terminate (object, invocation);
unref_skeleton_in_timeout (); unref_skeleton_in_timeout ();
return TRUE; /* handled */ return G_DBUS_METHOD_INVOCATION_HANDLED;
} }
static void static void
...@@ -812,10 +812,10 @@ new_connection_cb (GDBusServer *server, ...@@ -812,10 +812,10 @@ new_connection_cb (GDBusServer *server,
{ {
g_warning ("Unable to export object: %s", error->message); g_warning ("Unable to export object: %s", error->message);
g_dbus_connection_close (connection, NULL, NULL, NULL); g_dbus_connection_close (connection, NULL, NULL, NULL);
return TRUE; /* handled, unsuccessfully */ return G_DBUS_METHOD_INVOCATION_HANDLED;
} }
return TRUE; return G_DBUS_METHOD_INVOCATION_HANDLED;
} }
static GDBusServer * static GDBusServer *
......
...@@ -109,3 +109,8 @@ gchar *my_g_canonicalize_filename (const gchar *filename, ...@@ -109,3 +109,8 @@ gchar *my_g_canonicalize_filename (const gchar *filename,
gpointer *my_g_hash_table_get_keys_as_array (GHashTable *hash, gpointer *my_g_hash_table_get_keys_as_array (GHashTable *hash,
guint *len); guint *len);
#endif #endif
#if !GLIB_CHECK_VERSION (2, 67, 0)
#define G_DBUS_METHOD_INVOCATION_HANDLED TRUE
#define G_DBUS_METHOD_INVOCATION_UNHANDLED FALSE
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment