mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Merge pull request #849 from uvelichitel/master
Correct umount fusefs on FreeBSD. rel. issue #848
This commit is contained in:
commit
4178f62ece
|
@ -4437,7 +4437,7 @@ static bool remote_mount(char *newpath)
|
||||||
*/
|
*/
|
||||||
static bool unmount(char *name, char *newpath, int *presel, char *currentpath)
|
static bool unmount(char *name, char *newpath, int *presel, char *currentpath)
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#if defined (__APPLE__) || defined (__FreeBSD__)
|
||||||
static char cmd[] = "umount";
|
static char cmd[] = "umount";
|
||||||
#else
|
#else
|
||||||
static char cmd[] = "fusermount3"; /* Arch Linux utility */
|
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;
|
bool hovered = TRUE;
|
||||||
char mntpath[PATH_MAX];
|
char mntpath[PATH_MAX];
|
||||||
|
|
||||||
#ifndef __APPLE__
|
#if !defined ( __APPLE__) && !defined (__FreeBSD__)
|
||||||
/* On Ubuntu it's fusermount */
|
/* On Ubuntu it's fusermount */
|
||||||
if (!found && !getutil(cmd)) {
|
if (!found && !getutil(cmd)) {
|
||||||
cmd[10] = '\0';
|
cmd[10] = '\0';
|
||||||
|
@ -4484,7 +4484,7 @@ static bool unmount(char *name, char *newpath, int *presel, char *currentpath)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#if defined (__APPLE__) || defined (__FreeBSD__)
|
||||||
if (spawn(cmd, newpath, NULL, F_NORMAL)) {
|
if (spawn(cmd, newpath, NULL, F_NORMAL)) {
|
||||||
#else
|
#else
|
||||||
if (spawn(cmd, "-u", newpath, F_NORMAL)) {
|
if (spawn(cmd, "-u", newpath, F_NORMAL)) {
|
||||||
|
@ -4494,6 +4494,8 @@ static bool unmount(char *name, char *newpath, int *presel, char *currentpath)
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
if (spawn(cmd, "-l", newpath, F_NORMAL)) {
|
if (spawn(cmd, "-l", newpath, F_NORMAL)) {
|
||||||
|
#elif defined (__FreeBSD__)
|
||||||
|
if (spawn(cmd, "-f", newpath, F_NORMAL)) {
|
||||||
#else
|
#else
|
||||||
if (spawn(cmd, "-uz", newpath, F_NORMAL)) {
|
if (spawn(cmd, "-uz", newpath, F_NORMAL)) {
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue