From 9088061ab6a9f21f07380cfad55deb478e5164d0 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 21 Apr 2022 20:45:26 +0100 Subject: Fixup the shutdown of fuse_loop in test cases --- netfs/unittests/mockMount.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/netfs/unittests/mockMount.cpp b/netfs/unittests/mockMount.cpp index adf1804..5c6a0b8 100644 --- a/netfs/unittests/mockMount.cpp +++ b/netfs/unittests/mockMount.cpp @@ -21,13 +21,19 @@ FuseMountPoint::FuseMountPoint() : std::filesystem::remove_all(mntpnt); std::filesystem::create_directory(mntpnt); BOOST_REQUIRE_EQUAL(0, ::fuse_mount(fuseApp.fs, mntpnt.c_str())); - th.emplace(::fuse_loop, fuseApp.fs); + th.emplace( + [](auto fs) { + ::fuse_set_signal_handlers(fuse_get_session(fs)); + ::fuse_loop(fs); + }, + fuseApp.fs); BOOST_REQUIRE(th); } FuseMountPoint::~FuseMountPoint() { ::fuse_exit(fuseApp.fs); + pthread_sigqueue(th->native_handle(), SIGINT, {}); th->join(); ::fuse_unmount(fuseApp.fs); std::filesystem::remove(mntpnt); -- cgit v1.2.3