Cygwin, unmount

This commit is contained in:
benrubson 2018-03-26 23:19:52 +02:00
parent e8e1dc3595
commit 1a8a5e0246
2 changed files with 15 additions and 0 deletions

View File

@ -81,6 +81,13 @@ else()
set(DEFAULT_CASE_INSENSITIVE FALSE)
endif()
if (CYGWIN)
find_program(PKILL NAMES "pkill")
if(NOT PKILL)
message(FATAL_ERROR "pkill not found, please install procps-ng package.")
endif()
endif()
# Check for FUSE.
find_package (FUSE REQUIRED)
include_directories (SYSTEM ${FUSE_INCLUDE_DIR})

View File

@ -1739,6 +1739,14 @@ void unmountFS(const char *mountPoint) {
// fuse_unmount does not work on Mac OS, see #428
unmount(mountPoint, MNT_FORCE);
#endif
#ifdef __CYGWIN__
if(fork() == 0)
{
execl("/usr/bin/pkill", "/usr/bin/pkill", "-f", string("(^|/)encfs .*/.* ").append(mountPoint).append("?( |$)").c_str(), (char *)0);
}
int status;
wait(&status);
#endif
}
int remountFS(EncFS_Context *ctx) {