From 3064d72b9774029ab89daea8a7fccfe181c3cae0 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 5 Mar 2018 21:56:30 +0100 Subject: tests: fix a few fd leaks We relied on the finalizer to close a few fds. For some reason, this did not cause problems on Linux, but on MacOS, it causes unmount failures: umount(/private/tmp/gocryptfs-test-parent/194654785/default-plain): Resource busy -- try 'diskutil unmount' --- tests/defaults/diriv_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/defaults/diriv_test.go') diff --git a/tests/defaults/diriv_test.go b/tests/defaults/diriv_test.go index 75f1511..9aba1f2 100644 --- a/tests/defaults/diriv_test.go +++ b/tests/defaults/diriv_test.go @@ -45,7 +45,7 @@ func TestDirIVRace(t *testing.T) { for { // Keep dir2 in the diriv cache fd, err2 := os.Open(file2) - if err2 != nil { + if err2 == nil { fd.Close() } if stop { -- cgit v1.2.3