summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/unionfs.c12
-rw-r--r--src/cstore/unionfs/cstore-unionfs.cpp12
2 files changed, 24 insertions, 0 deletions
diff --git a/src/common/unionfs.c b/src/common/unionfs.c
index dff20e6..669858a 100644
--- a/src/common/unionfs.c
+++ b/src/common/unionfs.c
@@ -62,9 +62,21 @@ sys_cp(const char *src_file, const char *dst_file)
static inline void
sys_umount_session(void)
{
+#ifdef USE_UNIONFSFUSE
+ char umountcmd[MAX_LENGTH_DIR_PATH * 2];
+ const char *fusermount_call;
+ const char *umountfmt;
+ fusermount_call = "/usr/bin/fusermount -u ";
+ umountfmt = "%s %s";
+ snprintf(umountcmd, MAX_LENGTH_DIR_PATH * 4, umountfmt, fusermount_call, get_mdirp());
+ if (system(umountcmd) != 0) {
+ perror("umount");
+ }
+#else
if (umount(get_mdirp()) != 0) {
perror("umount");
}
+#endif
}
static inline void
diff --git a/src/cstore/unionfs/cstore-unionfs.cpp b/src/cstore/unionfs/cstore-unionfs.cpp
index 938436e..39d7634 100644
--- a/src/cstore/unionfs/cstore-unionfs.cpp
+++ b/src/cstore/unionfs/cstore-unionfs.cpp
@@ -1511,11 +1511,23 @@ UnionfsCstore::do_mount(const FsPath& rwdir, const FsPath& rdir,
bool
UnionfsCstore::do_umount(const FsPath& mdir)
{
+#ifdef USE_UNIONFSFUSE
+ string umount_cmd = "/usr/bin/fusermount -u ";
+ umount_cmd += mdir.path_cstr();
+
+ if (system(umount_cmd.c_str()) != 0)
+ {
+ output_internal("union umount failed [%s][%s]\n",
+ strerror(errno), mdir.path_cstr());
+ return(false);
+ }
+#else
if (umount(mdir.path_cstr()) != 0) {
output_internal("union umount failed [%s][%s]\n",
strerror(errno), mdir.path_cstr());
return false;
}
+#endif
return true;
}