mirror of
https://github.com/wso2/open-mcp-auth-proxy.git
synced 2025-06-27 17:13:31 +00:00
Handle spawning subprocess within windows
This commit is contained in:
parent
ad5185ad72
commit
68015ae8fc
5 changed files with 167 additions and 52 deletions
27
internal/subprocess/manager_windows.go
Normal file
27
internal/subprocess/manager_windows.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
//go:build windows
|
||||
|
||||
package subprocess
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// setProcAttr sets Windows-specific process attributes
|
||||
func setProcAttr(cmd *exec.Cmd) {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP,
|
||||
}
|
||||
}
|
||||
|
||||
// getProcessGroup returns the PID itself on Windows (no process groups)
|
||||
func getProcessGroup(pid int) (int, error) {
|
||||
return pid, nil
|
||||
}
|
||||
|
||||
// killProcessGroup kills a process on Windows (no process groups)
|
||||
func killProcessGroup(pgid int, signal syscall.Signal) error {
|
||||
// On Windows, we'll use the process handle directly
|
||||
// This function shouldn't be called on Windows, but we provide it for compatibility
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue