summaryrefslogtreecommitdiff
path: root/daemon/gvfsbackendafc.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2016-03-23 19:01:44 +0100
committerBastien Nocera <hadess@hadess.net>2016-06-09 11:37:57 +0200
commit04203326a76e6eaa20971004e3f276025113b0e9 (patch)
tree8986809c40af07785d8795240c4195f94d8bb3fc /daemon/gvfsbackendafc.c
parent6fe89ebd7ede76bfb98f93907fd92305e6de7cc4 (diff)
downloadgvfs-04203326a76e6eaa20971004e3f276025113b0e9.tar.gz
afc: Indicate whether to retry to setup HouseArrest for an app
If setting up the HouseArrest service for an app fails, we should clean up unused services, and try again. This tells us whether we should try again in the first place. https://bugzilla.gnome.org/show_bug.cgi?id=676188
Diffstat (limited to 'daemon/gvfsbackendafc.c')
-rw-r--r--daemon/gvfsbackendafc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
index d7048f0f..84f1a546 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -765,7 +765,7 @@ is_regular (GVfsBackendAfc *backend,
return result;
}
-static void
+static gboolean
g_vfs_backend_setup_afc_for_app (GVfsBackendAfc *self,
const char *id)
{
@@ -776,6 +776,7 @@ g_vfs_backend_setup_afc_for_app (GVfsBackendAfc *self,
afc_client_t afc;
plist_t dict, error;
lockdownd_error_t lerr;
+ gboolean retry = FALSE;
g_mutex_lock (&self->apps_lock);
@@ -796,6 +797,8 @@ 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;
lockdownd_client_free (lockdown_cli);
g_warning ("Failed to start house arrest for app %s (%d)", info->id, lerr);
goto out;
@@ -854,6 +857,7 @@ g_vfs_backend_setup_afc_for_app (GVfsBackendAfc *self,
out:
g_mutex_unlock (&self->apps_lock);
+ return !retry;
}
/* If force_afc_mount is TRUE, then we'll try to mount