mirror of
https://github.com/fuse-friends/fuse-native
synced 2025-06-13 12:53:54 +00:00
always use fusermount on linux
This commit is contained in:
parent
54c49272ee
commit
7a161e728d
@ -149,11 +149,22 @@ NAN_INLINE static void semaphore_wait (sem_t *sem) {
|
|||||||
NAN_INLINE static void semaphore_signal (sem_t *sem) {
|
NAN_INLINE static void semaphore_signal (sem_t *sem) {
|
||||||
sem_post(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
|
#endif
|
||||||
|
|
||||||
static void bindings_unmount (char *path) {
|
static void bindings_unmount (char *path) {
|
||||||
if (!strcmp(bindings.mnt, path) && bindings.fuse != NULL) {
|
if (!strcmp(bindings.mnt, path) && bindings.fuse != NULL) {
|
||||||
|
#ifdef __APPLE__
|
||||||
fuse_unmount(bindings.mnt, bindings.fuse_channel);
|
fuse_unmount(bindings.mnt, bindings.fuse_channel);
|
||||||
|
#else
|
||||||
|
bindings_fusermount(path);
|
||||||
|
#endif
|
||||||
pthread_join(bindings.thread, NULL);
|
pthread_join(bindings.thread, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -161,11 +172,7 @@ static void bindings_unmount (char *path) {
|
|||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
unmount(path, 0);
|
unmount(path, 0);
|
||||||
#else
|
#else
|
||||||
// TODO: if someone knows a better way to get this working on linux let me know
|
bindings_fusermount(path);
|
||||||
char *argv[] = {"fusermount", "-q", "-u", path, NULL};
|
|
||||||
pid_t cpid = vfork();
|
|
||||||
if (cpid > 0) waitpid(cpid, NULL, 0);
|
|
||||||
else execvp(argv[0], argv);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user