summaryrefslogtreecommitdiff
path: root/src/cstore/unionfs/cstore-unionfs.cpp
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2014-03-10 04:26:04 +0100
committerDaniil Baturin <daniil@baturin.org>2014-03-10 04:26:04 +0100
commitcbdc3037e17f45c7281d319bba8ca13f4c6ac977 (patch)
tree6c41babd3e6736e4655f1526be5b2440ea886f55 /src/cstore/unionfs/cstore-unionfs.cpp
parent7bd247f4b1b0ccd498f8f136d04e8ed19ade7d30 (diff)
downloadvyatta-cfg-cbdc3037e17f45c7281d319bba8ca13f4c6ac977.tar.gz
vyatta-cfg-cbdc3037e17f45c7281d319bba8ca13f4c6ac977.zip
Add umount functions for unionfs-fuse.
Diffstat (limited to 'src/cstore/unionfs/cstore-unionfs.cpp')
-rw-r--r--src/cstore/unionfs/cstore-unionfs.cpp12
1 files changed, 12 insertions, 0 deletions
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;
}