aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2020-02-12 16:58:20 +0200
committerMartin Pärtel <martin.partel@gmail.com>2020-02-12 17:09:13 +0200
commit2c2337b7c9b87744662c4b08d453bf7128444f43 (patch)
tree87c7aa5a72dab06105836b24aafd3e32c32be1b6
parentc3a2f98c1caa9cd7121432f3eab1b215b7f0a6ab (diff)
downloadbindfs-2c2337b7c9b87744662c4b08d453bf7128444f43.tar.gz
Don't add `-ononempty` on FUSE 3, where it has been removed.
FUSE 3 allows nonempty directories by default.
-rw-r--r--ChangeLog4
-rw-r--r--src/bindfs.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6793797..f22406b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2020-02-12 Martin Pärtel <martin dot partel at gmail dot com>
+
+ * Stop adding `-ononempty` when mounting a directory on itself with FUSE 3.
+
2020-01-08 Martin Pärtel <martin dot partel at gmail dot com>
* Fixed build with -fno-common, which is the default in GCC 10 (PR #81, thanks jengelh@!).
diff --git a/src/bindfs.c b/src/bindfs.c
index 22b446e..6051f2d 100644
--- a/src/bindfs.c
+++ b/src/bindfs.c
@@ -2393,8 +2393,9 @@ int main(int argc, char *argv[])
}
/* If the mount source and destination directories are the same
- then don't require that the directory be empty. */
- if (strcmp(settings.mntsrc, settings.mntdest) == 0)
+ then don't require that the directory be empty.
+ FUSE 3 removed support for -ononempty, allowing nonempty directories by default */
+ if (strcmp(settings.mntsrc, settings.mntdest) == 0 && fuse_version() < 30)
fuse_opt_add_arg(&args, "-ononempty");
/* Open mount source for chrooting in bindfs_init */