[gvfs/gnome-3-20] afc: Tweak HouseArrest warning output
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/gnome-3-20] afc: Tweak HouseArrest warning output
- Date: Thu, 9 Jun 2016 10:52:45 +0000 (UTC)
commit 8829a491145df9d432680322d8ead1510f93f5cc
Author: Bastien Nocera <hadess hadess net>
Date: Thu Jun 9 12:43:44 2016 +0200
afc: Tweak HouseArrest warning output
Only throw a warning when the second attempt at setting up HouseArrest
fails, not when we're going to retry. This makes it easier to see real
warnings compared to normal run-time behaviour.
daemon/gvfsbackendafc.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
index 382ca71..835e98d 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -780,6 +780,7 @@ is_regular (GVfsBackendAfc *backend,
static gboolean
g_vfs_backend_setup_afc_for_app (GVfsBackendAfc *self,
+ gboolean last_try,
const char *id)
{
AppInfo *info;
@@ -810,10 +811,14 @@ g_vfs_backend_setup_afc_for_app (GVfsBackendAfc *self,
lerr = lockdownd_start_service (lockdown_cli, "com.apple.mobile.house_arrest", &lockdown_service);
if (lerr != LOCKDOWN_E_SUCCESS)
{
- if (lerr == LOCKDOWN_E_SERVICE_LIMIT)
- retry = TRUE;
+ if (lerr == LOCKDOWN_E_SERVICE_LIMIT && !last_try)
+ {
+ retry = TRUE;
+ g_debug ("Failed to start house arrest for app %s (%d)\n", info->id, lerr);
+ }
+ else
+ g_warning ("Failed to start house arrest for app %s (%d)", info->id, lerr);
lockdownd_client_free (lockdown_cli);
- g_warning ("Failed to start house arrest for app %s (%d)", info->id, lerr);
goto out;
}
@@ -1009,11 +1014,11 @@ g_vfs_backend_parse_house_arrest_path (GVfsBackendAfc *self,
if (app != NULL &&
setup_afc)
{
- if (!g_vfs_backend_setup_afc_for_app (self, app))
+ if (!g_vfs_backend_setup_afc_for_app (self, FALSE, app))
{
g_debug ("Ran out of HouseArrest clients for app '%s', trying again\n", app);
g_vfs_backend_gc_house_arrest (self, app);
- g_vfs_backend_setup_afc_for_app (self, app);
+ g_vfs_backend_setup_afc_for_app (self, TRUE, app);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]