diff options
author | Jakob Unterwurzacher | 2021-12-08 18:49:21 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2021-12-08 18:49:21 +0100 |
commit | 7d60315cd53080e223051a4f16eb3ace3b86e095 (patch) | |
tree | b64657c619a23c90c48d788b0c7fcbd7ac16b157 /tests/defaults | |
parent | de22cb1e5dfba8f8b97a5da671bfb2b1a845afb7 (diff) |
tests: convert Creat() calls to Open()
Creat() is equivalent to Open(..., O_CREAT|O_WRONLY|O_TRUNC, ...)
and MacOS does not have syscall.Creat().
https://github.com/rfjakob/gocryptfs/issues/623
Diffstat (limited to 'tests/defaults')
-rw-r--r-- | tests/defaults/main_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/defaults/main_test.go b/tests/defaults/main_test.go index 5310003..43019ba 100644 --- a/tests/defaults/main_test.go +++ b/tests/defaults/main_test.go @@ -401,7 +401,7 @@ func TestMaxlen(t *testing.T) { func TestFsync(t *testing.T) { fileName := test_helpers.DefaultPlainDir + "/" + t.Name() + ".file" - fileFD, err := syscall.Creat(fileName, 0600) + fileFD, err := syscall.Open(fileName, syscall.O_CREAT|syscall.O_WRONLY|syscall.O_TRUNC, 0600) if err != nil { t.Fatal(err) } @@ -447,7 +447,7 @@ func TestForceOwner(t *testing.T) { // In the answer to a FUSE CREATE, gocryptfs sends file information including // the owner. This is cached by the kernel and will be used for the next // stat() call. - fd, err := syscall.Creat(foo, 0666) + fd, err := syscall.Open(foo, syscall.O_CREAT|syscall.O_WRONLY|syscall.O_EXCL, 0666) if err != nil { t.Fatal(err) } |