1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-24 22:50:49 +00:00
nixpkgs/pkgs/tools/filesystems/mp3fs/fix-statfs-operation.patch
Tobias Geerinckx-Rice 5bc5c6896e mp3fs: fix interoperation with samba
Ship and apply patch manually because building mp3fs from git is hell.

Also change meta.homepage to the one mentioned in the README.
2015-04-17 15:54:16 +02:00

40 lines
1 KiB
Diff

From fea072084ff9d7c4d2c688059a2462bb0e59a2ec Mon Sep 17 00:00:00 2001
From: K Henriksson <kthenriksson@gmail.com>
Date: Wed, 27 Aug 2014 21:55:18 -0700
Subject: [PATCH] Fix statfs operation
The statfs implementation does not properly translate names back to the
original, since the major encoding rewrite. This corrects that, and
should fix issue #27.
---
src/fuseops.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/fuseops.c b/src/fuseops.c
index e7b4e7e..c333cbd 100644
--- a/src/fuseops.c
+++ b/src/fuseops.c
@@ -337,9 +337,20 @@ static int mp3fs_statfs(const char *path, struct statvfs *stbuf) {
if (!origpath) {
goto translate_fail;
}
-
+
+ /* pass-through for regular files */
+ if (statvfs(origpath, stbuf) == 0) {
+ goto passthrough;
+ } else {
+ /* Not really an error. */
+ errno = 0;
+ }
+
+ find_original(origpath);
+
statvfs(origpath, stbuf);
-
+
+passthrough:
free(origpath);
translate_fail:
return -errno;