File: 001-disable-emulated-getdents.patch

package info (click to toggle)
gocryptfs 2.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,148 kB
file content (48 lines) | stat: -rw-r--r-- 1,433 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Description: Disable emulated getdents
 Upstream provides an emulation for the syscall Getdents, which does
 not exist on Darwin (MacOS). The test for that emulation fails with
 gccgo because libgo does not support reading a directory besed on a 
 file descriptor. (https://github.com/rfjakob/gocryptfs/issues/201)
 .
 The emulation is not needed in Debian, certainly not on those
 architectures running Linux, so it was disabled together with the
 test.
Author: Felix Lechner <felix.lechner@lease-up.com>
Forwarded: not-needed
Last-Update: 2018-02-03

--- a/internal/syscallcompat/getdents_other.go
+++ b/internal/syscallcompat/getdents_other.go
@@ -1,4 +1,6 @@
+// +build ignore
+
 package syscallcompat
 
 import (
 	"os"
--- a/internal/syscallcompat/getdents_test.go
+++ b/internal/syscallcompat/getdents_test.go
@@ -20,11 +20,8 @@
 
 func TestGetdents(t *testing.T) {
 	t.Logf("testing native getdents")
 	testGetdents(t)
-	t.Logf("testing emulateGetdents")
-	emulate = true
-	testGetdents(t)
 }
 
 // skipOnGccGo skips the emulateGetdents test when we are
 // running linux and were compiled with gccgo. The test is known to fail
@@ -44,11 +41,8 @@
 }
 
 func testGetdents(t *testing.T) {
 	getdentsUnderTest := getdents
-	if emulate {
-		getdentsUnderTest = emulateGetdents
-	}
 	// Fill a directory with filenames of length 1 ... 255
 	testDir, err := ioutil.TempDir(tmpDir, "TestGetdents")
 	if err != nil {
 		t.Fatal(err)