aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fuse.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fuse.c')
-rw-r--r--lib/fuse.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/lib/fuse.c b/lib/fuse.c
index 067d0dc..e456515 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -4558,11 +4558,30 @@ static int node_table_init(struct node_table *t)
return 0;
}
+static void thread_exit_handler(int sig)
+{
+ pthread_exit(0);
+}
+
static void *fuse_prune_nodes(void *fuse)
{
struct fuse *f = fuse;
int sleep_time;
+#if defined(__ANDROID__)
+ struct sigaction actions;
+ memset(&actions, 0, sizeof(actions));
+ sigemptyset(&actions.sa_mask);
+ actions.sa_flags = 0;
+ actions.sa_handler = thread_exit_handler;
+ sigaction(SIGUSR1, &actions, NULL);
+
+ sigset_t setusr1;
+ sigemptyset(&setusr1);
+ sigaddset(&setusr1, SIGUSR1);
+ pthread_sigmask(SIG_BLOCK, &setusr1, NULL);
+#endif
+
while(1) {
sleep_time = fuse_clean_cache(f);
sleep(sleep_time);
@@ -4582,7 +4601,11 @@ void fuse_stop_cleanup_thread(struct fuse *f)
{
if (lru_enabled(f)) {
pthread_mutex_lock(&f->lock);
+#if defined(__ANDROID__)
+ pthread_kill(f->prune_thread, SIGUSR1);
+#else
pthread_cancel(f->prune_thread);
+#endif
pthread_mutex_unlock(&f->lock);
pthread_join(f->prune_thread, NULL);
}
@@ -4873,11 +4896,11 @@ struct fuse *fuse_new_compat1(int fd, int flags,
11);
}
-FUSE_SYMVER(".symver fuse_exited,__fuse_exited@");
-FUSE_SYMVER(".symver fuse_process_cmd,__fuse_process_cmd@");
-FUSE_SYMVER(".symver fuse_read_cmd,__fuse_read_cmd@");
-FUSE_SYMVER(".symver fuse_set_getcontext_func,__fuse_set_getcontext_func@");
-FUSE_SYMVER(".symver fuse_new_compat2,fuse_new@");
+FUSE_SYMVER(".symver fuse_exited,__fuse_exited@FUSE_UNVERSIONED");
+FUSE_SYMVER(".symver fuse_process_cmd,__fuse_process_cmd@FUSE_UNVERSIONED");
+FUSE_SYMVER(".symver fuse_read_cmd,__fuse_read_cmd@FUSE_UNVERSIONED");
+FUSE_SYMVER(".symver fuse_set_getcontext_func,__fuse_set_getcontext_func@FUSE_UNVERSIONED");
+FUSE_SYMVER(".symver fuse_new_compat2,fuse_new@FUSE_UNVERSIONED");
FUSE_SYMVER(".symver fuse_new_compat22,fuse_new@FUSE_2.2");
#endif /* __FreeBSD__ || __NetBSD__ */