1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
From 23c187385db3228bd01520fc0dc7f83cd988e37a Mon Sep 17 00:00:00 2001
From: Alexandr Ilenko <AIlenko@IBS.RU>
Date: Mon, 20 Jun 2022 09:56:47 +0300
Subject: [PATCH 08/20] virtual-media.3: Upd: Use "::umount2(.)" instead of
"::umount(.)"
---
src/resources.hpp | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/resources.hpp b/src/resources.hpp
index b211d55..e307955 100644
--- a/src/resources.hpp
+++ b/src/resources.hpp
@@ -88,10 +88,17 @@ class Mount
~Mount()
{
- if (int result = ::umount(directory->getPath().string().c_str()))
+ if (int result = ::umount2(directory->getPath().string().c_str(), MNT_DETACH))
{
- LogMsg(Logger::Error, result, " : Unable to unmout directory ",
+ LogMsg(Logger::Error, result, " : Unable to lazy unmout directory. Attempt to force umount ",
directory->getPath());
+ result = ::umount2(directory->getPath().string().c_str(), MNT_FORCE);
+ if (result)
+ {
+ LogMsg(Logger::Error, result, " : Unable to unmout directory ",
+ directory->getPath().string());
+ return;
+ }
}
}
--
2.35.1
|