/internal/storage/dolt: fix windows build issue

This commit is contained in:
Test
2026-01-21 13:59:47 -08:00
parent 0a9bcc2dd0
commit 7670112341
5 changed files with 91 additions and 27 deletions

View File

@@ -0,0 +1,32 @@
//go:build !windows
// +build !windows
package dolt
import (
"os"
"strings"
"syscall"
)
func processMayBeAlive(p *os.Process) bool {
// Signal 0 checks for existence without sending a real signal.
if err := p.Signal(syscall.Signal(0)); err != nil {
return false
}
return true
}
func terminateProcess(p *os.Process) error {
if p == nil {
return nil
}
if err := p.Signal(syscall.SIGTERM); err != nil {
// Process may already be dead; treat as success.
if strings.Contains(err.Error(), "process already finished") {
return nil
}
return err
}
return nil
}