diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2011-01-25 11:46:15 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2011-01-25 11:46:15 +0100 |
commit | 6d5e12e1b6abc2f07af547478f2497e06df988b1 (patch) | |
tree | 0ef4d9f5eaba6acc7ca5016cf5e2cd32119dfef1 /sshfs.c | |
parent | b1b0c4b6f58d278360243705cc1e67522ef23423 (diff) | |
download | sshfs-6d5e12e1b6abc2f07af547478f2497e06df988b1.tar sshfs-6d5e12e1b6abc2f07af547478f2497e06df988b1.tar.gz sshfs-6d5e12e1b6abc2f07af547478f2497e06df988b1.tar.bz2 sshfs-6d5e12e1b6abc2f07af547478f2497e06df988b1.zip |
Fix cleanup when ssh connection is terminated.
This prevents sshfs hanging when the server is rebooted, for example.
Diffstat (limited to 'sshfs.c')
-rw-r--r-- | sshfs.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -1314,17 +1314,16 @@ static void *process_requests(void *data_) break; } + pthread_mutex_lock(&sshfs.lock); + sshfs.processing_thread_started = 0; + close_conn(); + g_hash_table_foreach_remove(sshfs.reqtab, (GHRFunc) clean_req, NULL); + sshfs.connver ++; + pthread_mutex_unlock(&sshfs.lock); + if (!sshfs.reconnect) { /* harakiri */ kill(getpid(), SIGTERM); - } else { - pthread_mutex_lock(&sshfs.lock); - sshfs.processing_thread_started = 0; - close_conn(); - g_hash_table_foreach_remove(sshfs.reqtab, (GHRFunc) clean_req, - NULL); - sshfs.connver ++; - pthread_mutex_unlock(&sshfs.lock); } return NULL; } |