Skip to content

Commit fcd92f5

Browse files
committed
For fuse-t, give some time for value return during exit
1 parent e791547 commit fcd92f5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sources/fuse2_workaround.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "fuse2_workaround.h"
22
#include "is_fuse_t.h"
33

4+
#include <chrono>
45
#include <fuse.h>
56

67
#include <csignal>
@@ -112,7 +113,13 @@ void clean_exit_fuse()
112113
{
113114
if (is_fuse_t())
114115
{
115-
kill(getpid(), SIGINT);
116+
std::thread t(
117+
[]()
118+
{
119+
std::this_thread::sleep_for(std::chrono::milliseconds(200));
120+
kill(getpid(), SIGINT);
121+
});
122+
t.detach();
116123
}
117124
else
118125
{

0 commit comments

Comments
 (0)