[gvfs] client: Use g_warning if proxy creation failed
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] client: Use g_warning if proxy creation failed
- Date: Fri, 2 Oct 2015 10:46:58 +0000 (UTC)
commit eef594d24918d28ad5f0f736825a333df955c6c4
Author: Ondrej Holy <oholy redhat com>
Date: Wed Sep 30 15:03:05 2015 +0200
client: Use g_warning if proxy creation failed
Currently g_errprint is used and thus a message doesn't end up in a logs.
Use g_warning to log the message and also replace g_return_if_fail,
because proxy creation failure isn't programmer error.
https://bugzilla.gnome.org/show_bug.cgi?id=755805
client/gdaemonvfs.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index 11435e8..caf846a 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -575,7 +575,7 @@ create_mount_tracker_proxy ()
&error);
if (proxy == NULL)
{
- g_printerr ("Error creating proxy: %s (%s, %d)\n",
+ g_warning ("Error creating proxy: %s (%s, %d)\n",
error->message, g_quark_to_string (error->domain), error->code);
g_error_free (error);
}
@@ -599,7 +599,8 @@ fill_mountable_info (GDaemonVfs *vfs)
gboolean host_is_inet;
proxy = create_mount_tracker_proxy ();
- g_return_if_fail (proxy != NULL);
+ if (proxy == NULL)
+ return;
error = NULL;
if (!gvfs_dbus_mount_tracker_call_list_mountable_info_sync (proxy,
@@ -949,7 +950,8 @@ _g_daemon_vfs_get_mount_info_sync (GMountSpec *spec,
return info;
proxy = create_mount_tracker_proxy ();
- g_return_val_if_fail (proxy != NULL, NULL);
+ if (proxy == NULL)
+ return NULL;
if (gvfs_dbus_mount_tracker_call_lookup_mount_sync (proxy,
g_mount_spec_to_dbus_with_path (spec, path),
@@ -982,7 +984,8 @@ _g_daemon_vfs_get_mount_info_by_fuse_sync (const char *fuse_path,
return info;
proxy = create_mount_tracker_proxy ();
- g_return_val_if_fail (proxy != NULL, NULL);
+ if (proxy == NULL)
+ return NULL;
if (gvfs_dbus_mount_tracker_call_lookup_mount_by_fuse_path_sync (proxy,
fuse_path,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]