diff options
author | Daniil Baturin <daniil@baturin.org> | 2014-03-10 04:26:04 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2014-03-10 04:26:04 +0100 |
commit | cbdc3037e17f45c7281d319bba8ca13f4c6ac977 (patch) | |
tree | 6c41babd3e6736e4655f1526be5b2440ea886f55 /src/common/unionfs.c | |
parent | 7bd247f4b1b0ccd498f8f136d04e8ed19ade7d30 (diff) | |
download | vyatta-cfg-cbdc3037e17f45c7281d319bba8ca13f4c6ac977.tar.gz vyatta-cfg-cbdc3037e17f45c7281d319bba8ca13f4c6ac977.zip |
Add umount functions for unionfs-fuse.
Diffstat (limited to 'src/common/unionfs.c')
-rw-r--r-- | src/common/unionfs.c | 12 |
1 files changed, 12 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 |