X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgdbus-tool.c;h=f24dd71159ec846898b03755c635db7de748f424;hb=f2786908a8858ec9d063e8fae7e4b2d8d612b682;hp=01a6c68d5901a8e75a7e4c7fa51c0ec95efe5c06;hpb=4b94c0831e449374ce769cb4938a28b3dca59a43;p=platform%2Fupstream%2Fglib.git
diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c
index 01a6c68..f24dd71 100644
--- a/gio/gdbus-tool.c
+++ b/gio/gdbus-tool.c
@@ -13,9 +13,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see .
*
* Author: David Zeuthen
*/
@@ -671,18 +669,24 @@ handle_emit (gint *argc,
&error);
if (value == NULL)
{
+ gchar *context;
+
+ context = g_variant_parse_error_print_context (error, (*argv)[n]);
g_error_free (error);
error = NULL;
value = _g_variant_parse_me_harder (NULL, (*argv)[n], &error);
if (value == NULL)
{
+ /* Use the original non-"parse-me-harder" error */
g_printerr (_("Error parsing parameter %d: %s\n"),
n,
- error->message);
+ context);
g_error_free (error);
+ g_free (context);
g_variant_builder_clear (&builder);
goto out;
}
+ g_free (context);
}
g_variant_builder_add_value (&builder, value);
}
@@ -973,6 +977,9 @@ handle_call (gint *argc,
&error);
if (value == NULL)
{
+ gchar *context;
+
+ context = g_variant_parse_error_print_context (error, (*argv)[n]);
g_error_free (error);
error = NULL;
value = _g_variant_parse_me_harder (type, (*argv)[n], &error);
@@ -984,19 +991,21 @@ handle_call (gint *argc,
g_printerr (_("Error parsing parameter %d of type '%s': %s\n"),
n,
s,
- error->message);
+ context);
g_free (s);
}
else
{
g_printerr (_("Error parsing parameter %d: %s\n"),
n,
- error->message);
+ context);
}
g_error_free (error);
g_variant_builder_clear (&builder);
+ g_free (context);
goto out;
}
+ g_free (context);
}
g_variant_builder_add_value (&builder, value);
}
@@ -1017,8 +1026,11 @@ handle_call (gint *argc,
&error);
if (result == NULL)
{
- g_printerr (_("Error: %s\n"), error->message);
- g_error_free (error);
+ if (error)
+ {
+ g_printerr (_("Error: %s\n"), error->message);
+ g_error_free (error);
+ }
if (in_signature_types != NULL)
{
GString *s;
@@ -1723,16 +1735,12 @@ handle_monitor (gint *argc,
gchar *s;
GError *error;
GDBusConnection *c;
- GVariant *result;
- GDBusNodeInfo *node;
gboolean complete_names;
gboolean complete_paths;
GMainLoop *loop;
ret = FALSE;
c = NULL;
- node = NULL;
- result = NULL;
modify_argv0_for_command (argc, argv, "monitor");
@@ -1875,10 +1883,6 @@ handle_monitor (gint *argc,
ret = TRUE;
out:
- if (node != NULL)
- g_dbus_node_info_unref (node);
- if (result != NULL)
- g_variant_unref (result);
if (c != NULL)
g_object_unref (c);
g_option_context_free (o);