From 0d0490b781c7b846588941fde9ece264d3575e37 Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Sun, 22 Mar 2015 12:34:05 +0100 Subject: [PATCH] just use umount - much more reliable --- fuse-bindings.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/fuse-bindings.cc b/fuse-bindings.cc index c5cac55..14bc0f6 100644 --- a/fuse-bindings.cc +++ b/fuse-bindings.cc @@ -154,13 +154,6 @@ NAN_INLINE static void semaphore_wait (sem_t *sem) { NAN_INLINE static void semaphore_signal (sem_t *sem) { sem_post(sem); } - -static void bindings_fusermount (char *path) { - char *argv[] = {(char *) "fusermount", (char *) "-q", (char *) "-u", path, NULL}; - pid_t cpid = vfork(); - if (cpid > 0) waitpid(cpid, NULL, 0); - else execvp(argv[0], argv); -} #endif static bindings_t *bindings_find_mounted (char *path) { @@ -173,15 +166,22 @@ static bindings_t *bindings_find_mounted (char *path) { return NULL; } +static void bindings_fusermount (char *path) { +#ifdef __APPLE__ + char *argv[] = {(char *) "umount", path, NULL}; +#else + char *argv[] = {(char *) "fusermount", (char *) "-q", (char *) "-u", path, NULL}; +#endif + pid_t cpid = vfork(); + if (cpid > 0) waitpid(cpid, NULL, 0); + else execvp(argv[0], argv); +} + static void bindings_unmount (char *path) { pthread_mutex_lock(&mutex); bindings_t *b = bindings_find_mounted(path); if (b != NULL) b->gc = 1; -#ifdef __APPLE__ - unmount(path, 0); -#else bindings_fusermount(path); -#endif if (b != NULL) pthread_join(b->thread, NULL); pthread_mutex_unlock(&mutex); }