[gvfs] sftp: Don't call g_vfs_backend_force_unmount multiple times



commit e1a3c297aa38c86b19705a03555d322eaa944ff7
Author: Ross Lagerwall <rosslagerwall gmail com>
Date:   Sat Sep 5 13:39:17 2015 +0100

    sftp: Don't call g_vfs_backend_force_unmount multiple times
    
    If the remote connection(s) are closed (e.g. the remote host is
    rebooted), ensure that g_vfs_backend_force_unmount is only called once.
    
    This avoids a warning like the following:
    forced_unregister_mount_callback
    forced_unregister_mount_callback
    
    ** (process:12472): WARNING **: Error unregistering mount: Mountpoint
    not registered (g-io-error-quark, 16)
    
    Additionally, remove some backend member variables.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753311

 daemon/gvfsbackendsftp.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index ae0c363..c301dc9 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -205,9 +205,7 @@ struct _GVfsBackendSftp
   Connection command_connection;
   Connection data_connection;
 
-  GMountSource *mount_source; /* Only used/set during mount */
-  int mount_try;
-  gboolean mount_try_again;
+  gboolean force_unmounted;
 };
 
 static void parse_attributes (GVfsBackendSftp *backend,
@@ -1330,6 +1328,11 @@ fail_jobs (Connection *conn, GError *error)
 static void
 fail_jobs_and_unmount (GVfsBackendSftp *backend, GError *error)
 {
+  if (backend->force_unmounted)
+    return;
+
+  backend->force_unmounted = TRUE;
+
   fail_jobs (&backend->command_connection, error);
   fail_jobs (&backend->data_connection, error);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]