From: Rostislav Skudnov Date: Mon, 23 Jul 2018 07:31:00 +0000 (+0000) Subject: test_write_cache: Use fuse_session_exit() to stop filesystem thread X-Git-Tag: fuse-3.2.5~2 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=055fcec831aff1037f5240f50481827b847f8cfa;p=qemu-gpiodev%2Flibfuse.git 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. --- 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);