summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-04-21 20:45:26 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-04-21 20:45:26 +0100
commit9088061ab6a9f21f07380cfad55deb478e5164d0 (patch)
tree408e386ace906014b1f1137bf523677da6673fe6
parentAdd a basic perf test setup for key functions (diff)
downloadnetfs-9088061ab6a9f21f07380cfad55deb478e5164d0.tar.bz2
netfs-9088061ab6a9f21f07380cfad55deb478e5164d0.tar.xz
netfs-9088061ab6a9f21f07380cfad55deb478e5164d0.zip
Fixup the shutdown of fuse_loop in test cases
-rw-r--r--netfs/unittests/mockMount.cpp8
1 files changed, 7 insertions, 1 deletions
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);