Skip to content

Commit 584eb13

Browse files
author
Johan Knutzen
committed
syscall: rename variable DontInheritHandles to NoInheritHandles
Fixes #42098
1 parent 4b28153 commit 584eb13

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

doc/go1.16.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
334334
<dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
335335
<dd>
336336
<p><!-- CL 261917 -->
337-
<a href="/pkg/syscall/#SysProcAttr"><code>SysProcAttr</code></a> on Windows has a new DontInheritHandles field that disables inheriting handles when creating a new process.
337+
<a href="/pkg/syscall/#SysProcAttr"><code>SysProcAttr</code></a> on Windows has a new NoInheritHandles field that disables inheriting handles when creating a new process.
338338
</p>
339339
</dd>
340340
</dl><!-- syscall -->

src/syscall/exec_windows.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,13 @@ type ProcAttr struct {
235235
}
236236

237237
type SysProcAttr struct {
238-
HideWindow bool
239-
CmdLine string // used if non-empty, else the windows command line is built by escaping the arguments passed to StartProcess
240-
CreationFlags uint32
241-
Token Token // if set, runs new process in the security context represented by the token
242-
ProcessAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the new process
243-
ThreadAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the main thread of the new process
244-
DontInheritHandles bool // if set, each inheritable handle in the calling process is not inherited by the new process
238+
HideWindow bool
239+
CmdLine string // used if non-empty, else the windows command line is built by escaping the arguments passed to StartProcess
240+
CreationFlags uint32
241+
Token Token // if set, runs new process in the security context represented by the token
242+
ProcessAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the new process
243+
ThreadAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the main thread of the new process
244+
NoInheritHandles bool // if set, each inheritable handle in the calling process is not inherited by the new process
245245
}
246246

247247
var zeroProcAttr ProcAttr
@@ -342,9 +342,9 @@ func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle
342342

343343
flags := sys.CreationFlags | CREATE_UNICODE_ENVIRONMENT
344344
if sys.Token != 0 {
345-
err = CreateProcessAsUser(sys.Token, argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, !sys.DontInheritHandles, flags, createEnvBlock(attr.Env), dirp, si, pi)
345+
err = CreateProcessAsUser(sys.Token, argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, !sys.NoInheritHandles, flags, createEnvBlock(attr.Env), dirp, si, pi)
346346
} else {
347-
err = CreateProcess(argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, !sys.DontInheritHandles, flags, createEnvBlock(attr.Env), dirp, si, pi)
347+
err = CreateProcess(argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, !sys.NoInheritHandles, flags, createEnvBlock(attr.Env), dirp, si, pi)
348348
}
349349
if err != nil {
350350
return 0, 0, err

0 commit comments

Comments
 (0)