aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Rostislav Skudnov <rostislav@tuxera.com>2018-07-23 07:31:00 +0000
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2018-07-23 11:02:57 +0100
commit055fcec831aff1037f5240f50481827b847f8cfa (patch)
treedaaa37bc2589b3ae2c7e26905e17b8ca19ff6177
parenta2a09e7cca6ddda42c5523654df057fa1578500e (diff)
test_write_cache: Use fuse_session_exit() to stop filesystem thread
Using fuse_session_exit() followed by fuse_session_unmount() ensures that a proper cleanup and shutdown is performed.
-rw-r--r--test/test_write_cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/test_write_cache.c b/test/test_write_cache.c
index 7a6d7e6..f91cbb6 100644
--- a/test/test_write_cache.c
+++ b/test/test_write_cache.c
@@ -205,9 +205,10 @@ int main(int argc, char *argv[]) {
free(fuse_opts.mountpoint);
/* Stop file system */
- assert(pthread_cancel(fs_thread) == 0);
-
+ fuse_session_exit(se);
fuse_session_unmount(se);
+ assert(pthread_join(fs_thread, NULL) == 0);
+
assert(got_write == 1);
fuse_remove_signal_handlers(se);
fuse_session_destroy(se);