Skip to content

Commit

Permalink
Problem stopping a sandbox on Mac #465
Browse files Browse the repository at this point in the history
  • Loading branch information
pmi authored and alansemenov committed Sep 26, 2023
1 parent 53b3b92 commit f82dc79
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
5 changes: 3 additions & 2 deletions internal/app/util/system/system_others.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//+build !windows
//go:build !windows
// +build !windows

package system

Expand All @@ -10,7 +11,7 @@ import (
"syscall"
)

const detachedProcName = ""
const detachedProcName = "java"

func prepareCmd(app string, args []string) *exec.Cmd {
cmd := exec.Command(app, args...)
Expand Down
19 changes: 10 additions & 9 deletions internal/app/util/system/system_wins.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package system
Expand All @@ -20,25 +21,25 @@ func prepareCmd(app string, args []string) *exec.Cmd {
}

/*
Description of the '@' trick to prevent quote stripping by cmd.exe
https://github.com/Microsoft/WSL/issues/2835#issuecomment-364475668
*/
Description of the '@' trick to prevent quote stripping by cmd.exe
https://github.com/Microsoft/WSL/issues/2835#issuecomment-364475668
*/
func setCommandLineParams(cmd *exec.Cmd, app string, args []string) {
cmd.SysProcAttr.CmdLine = fmt.Sprintf(` /c @ "%v" %v`, app, strings.Join(args, " "))
}

/*
https://docs.microsoft.com/en-us/windows/desktop/procthread/process-creation-flags
CREATE_NEW_PROCESS_GROUP = 0x00000200
*/
https://docs.microsoft.com/en-us/windows/desktop/procthread/process-creation-flags
CREATE_NEW_PROCESS_GROUP = 0x00000200
*/
func setStartAttachedParams(cmd *exec.Cmd) {
//cmd.SysProcAttr.CreationFlags = 0x00000200
}

/*
https://docs.microsoft.com/en-us/windows/desktop/procthread/process-creation-flags
CREATE_NEW_PROCESS_GROUP = 0x00000200
CREATE_NO_WINDOW = 0x08000000
https://docs.microsoft.com/en-us/windows/desktop/procthread/process-creation-flags
CREATE_NEW_PROCESS_GROUP = 0x00000200
CREATE_NO_WINDOW = 0x08000000
*/
func setStartDetachedParams(cmd *exec.Cmd) {
cmd.SysProcAttr.CreationFlags = 0x08000200
Expand Down

0 comments on commit f82dc79

Please sign in to comment.