test_write_cache: Use fuse_session_exit() to stop filesystem thread
authorRostislav Skudnov <rostislav@tuxera.com>
Mon, 23 Jul 2018 07:31:00 +0000 (07:31 +0000)
committerNikolaus Rath <Nikolaus@rath.org>
Mon, 23 Jul 2018 10:02:57 +0000 (11:02 +0100)
Using fuse_session_exit() followed by fuse_session_unmount() ensures
that a proper cleanup and shutdown is performed.

test/test_write_cache.c

index 7a6d7e6899a171c4b7482c6efe736aaf0873c9f2..f91cbb6bfd7e4849f0db15da5677402aa08811be 100644 (file)
@@ -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);