summaryrefslogtreecommitdiff
path: root/daemon/gvfsbackendafc.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2016-06-09 12:43:44 +0200
committerBastien Nocera <hadess@hadess.net>2016-06-09 12:43:44 +0200
commit36f3ab7147c31e5dc067aebedb5c38dc163ffbd3 (patch)
treeca8c8532b9889f5bc08f04fa253ca06afcd38761 /daemon/gvfsbackendafc.c
parentd65e2d2454411f51a1b5463ddae97c1adafc4250 (diff)
downloadgvfs-36f3ab7147c31e5dc067aebedb5c38dc163ffbd3.tar.gz
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.
Diffstat (limited to 'daemon/gvfsbackendafc.c')
-rw-r--r--daemon/gvfsbackendafc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
index 7d51ce4e..f1b17587 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -811,6 +811,7 @@ is_regular (GVfsBackendAfc *backend,
static gboolean
g_vfs_backend_setup_afc_for_app (GVfsBackendAfc *self,
+ gboolean last_try,
const char *id)
{
AppInfo *info;
@@ -841,10 +842,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;
}
@@ -1040,11 +1045,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);
}
}