From: uvelichitel Date: Sat, 30 Jan 2021 21:47:09 +0000 (+0300) Subject: Correct umount fusefs on FreeBSD X-Git-Tag: v3.6~24^2 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=3776f72af1887231eb993622d602fb58f527d83c;p=nnn.git Correct umount fusefs on FreeBSD --- diff --git a/src/nnn.c b/src/nnn.c index 15857cf0..9066f7f3 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -4437,7 +4437,7 @@ static bool remote_mount(char *newpath) */ static bool unmount(char *name, char *newpath, int *presel, char *currentpath) { -#ifdef __APPLE__ +#if defined (__APPLE__) || defined (__FreeBSD__) static char cmd[] = "umount"; #else static char cmd[] = "fusermount3"; /* Arch Linux utility */ @@ -4450,7 +4450,7 @@ static bool unmount(char *name, char *newpath, int *presel, char *currentpath) bool hovered = TRUE; char mntpath[PATH_MAX]; -#ifndef __APPLE__ +#if !defined ( __APPLE__) && !defined (__FreeBSD__) /* On Ubuntu it's fusermount */ if (!found && !getutil(cmd)) { cmd[10] = '\0'; @@ -4484,7 +4484,7 @@ static bool unmount(char *name, char *newpath, int *presel, char *currentpath) return FALSE; } -#ifdef __APPLE__ +#if defined (__APPLE__) || defined (__FreeBSD__) if (spawn(cmd, newpath, NULL, F_NORMAL)) { #else if (spawn(cmd, "-u", newpath, F_NORMAL)) { @@ -4494,6 +4494,8 @@ static bool unmount(char *name, char *newpath, int *presel, char *currentpath) #ifdef __APPLE__ if (spawn(cmd, "-l", newpath, F_NORMAL)) { +#elif defined (__FreeBSD__) + if (spawn(cmd, "-f", newpath, F_NORMAL)) { #else if (spawn(cmd, "-uz", newpath, F_NORMAL)) { #endif