fuse(4): fix a race condition in the tests
Sometimes the fuse daemon doesn't die as soon as its /dev/fuse file descriptor is closed; it needs to be unmounted first. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
b1397d8fd5
commit
0fdf4eed76
@ -307,6 +307,10 @@ MockFS::MockFS(int max_readahead, bool push_symlinks_in,
|
||||
MockFS::~MockFS() {
|
||||
kill_daemon();
|
||||
::unmount("mountpoint", MNT_FORCE);
|
||||
if (m_daemon_id != NULL) {
|
||||
pthread_join(m_daemon_id, NULL);
|
||||
m_daemon_id = NULL;
|
||||
}
|
||||
rmdir("mountpoint");
|
||||
}
|
||||
|
||||
@ -353,8 +357,6 @@ void MockFS::kill_daemon() {
|
||||
// to succeed even if the daemon doesn't correctly respond to
|
||||
// commands during the unmount sequence.
|
||||
close(m_fuse_fd);
|
||||
pthread_join(m_daemon_id, NULL);
|
||||
m_daemon_id = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user