all: add support for zos/s390x
This adds net support for zos/s390x. These changes should not affect other platforms.
Fixes golang/go#42130
Change-Id: Ia7faa29de76b7c5713120657b296106c2e27bfd2
Reviewed-on: https://go-review.googlesource.com/c/net/+/264028
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
diff --git a/webdav/file.go b/webdav/file.go
index 9f53778..3fcc053 100644
--- a/webdav/file.go
+++ b/webdav/file.go
@@ -12,6 +12,7 @@
"os"
"path"
"path/filepath"
+ "runtime"
"strings"
"sync"
"time"
@@ -272,8 +273,14 @@
var n *memFSNode
if dir == nil {
// We're opening the root.
- if flag&(os.O_WRONLY|os.O_RDWR) != 0 {
- return nil, os.ErrPermission
+ if runtime.GOOS == "zos" {
+ if flag&os.O_WRONLY != 0 {
+ return nil, os.ErrPermission
+ }
+ } else {
+ if flag&(os.O_WRONLY|os.O_RDWR) != 0 {
+ return nil, os.ErrPermission
+ }
}
n, frag = &fs.root, "/"