mirror of
https://github.com/golang/go
synced 2024-11-23 00:20:12 -07:00
syscall: rename variable DontInheritHandles to NoInheritHandles
Fixes #42098
This commit is contained in:
parent
4b281535a0
commit
584eb13e36
@ -334,7 +334,7 @@ Do not send CLs removing the interior tags from such phrases.
|
||||
<dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 261917 -->
|
||||
<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.
|
||||
<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.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- syscall -->
|
||||
|
@ -241,7 +241,7 @@ type SysProcAttr struct {
|
||||
Token Token // if set, runs new process in the security context represented by the token
|
||||
ProcessAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the new process
|
||||
ThreadAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the main thread of the new process
|
||||
DontInheritHandles bool // if set, each inheritable handle in the calling process is not inherited by the new process
|
||||
NoInheritHandles bool // if set, each inheritable handle in the calling process is not inherited by the new process
|
||||
}
|
||||
|
||||
var zeroProcAttr ProcAttr
|
||||
@ -342,9 +342,9 @@ func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle
|
||||
|
||||
flags := sys.CreationFlags | CREATE_UNICODE_ENVIRONMENT
|
||||
if sys.Token != 0 {
|
||||
err = CreateProcessAsUser(sys.Token, argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, !sys.DontInheritHandles, flags, createEnvBlock(attr.Env), dirp, si, pi)
|
||||
err = CreateProcessAsUser(sys.Token, argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, !sys.NoInheritHandles, flags, createEnvBlock(attr.Env), dirp, si, pi)
|
||||
} else {
|
||||
err = CreateProcess(argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, !sys.DontInheritHandles, flags, createEnvBlock(attr.Env), dirp, si, pi)
|
||||
err = CreateProcess(argv0p, argvp, sys.ProcessAttributes, sys.ThreadAttributes, !sys.NoInheritHandles, flags, createEnvBlock(attr.Env), dirp, si, pi)
|
||||
}
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
|
Loading…
Reference in New Issue
Block a user