-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgo-winfsd.patch
More file actions
23 lines (22 loc) · 816 Bytes
/
go-winfsd.patch
File metadata and controls
23 lines (22 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff --git a/src/syscall/syscall_windows.go b/src/syscall/syscall_windows.go
index de05840..e1455d5 100644
--- a/src/syscall/syscall_windows.go
+++ b/src/syscall/syscall_windows.go
@@ -245,6 +245,8 @@ func makeInheritSa() *SecurityAttributes {
return &sa
}
+var Open_FileShareDelete = false // added for github.com/networkimprov/mnm-hammer
+
func Open(path string, mode int, perm uint32) (fd Handle, err error) {
if len(path) == 0 {
return InvalidHandle, ERROR_FILE_NOT_FOUND
@@ -270,6 +272,9 @@ func Open(path string, mode int, perm uint32) (fd Handle, err error) {
access |= FILE_APPEND_DATA
}
sharemode := uint32(FILE_SHARE_READ | FILE_SHARE_WRITE)
+ if Open_FileShareDelete {
+ sharemode |= FILE_SHARE_DELETE
+ }
var sa *SecurityAttributes
if mode&O_CLOEXEC == 0 {
sa = makeInheritSa()