mirror of https://github.com/Hilbis/Hilbish
fix: set bg proc attr in build tagged file
parent
1522749397
commit
4bc94ce916
12
exec.go
12
exec.go
|
@ -359,18 +359,6 @@ func execHandle(bg bool) interp.ExecHandlerFunc {
|
||||||
|
|
||||||
var j *job
|
var j *job
|
||||||
if bg {
|
if bg {
|
||||||
var procAttr *syscall.SysProcAttr
|
|
||||||
if runtime.GOOS == "windows" {
|
|
||||||
procAttr = &syscall.SysProcAttr{
|
|
||||||
CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP,
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
procAttr = &syscall.SysProcAttr{
|
|
||||||
Setpgid: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cmd.SysProcAttr = procAttr
|
|
||||||
|
|
||||||
j = jobs.getLatest()
|
j = jobs.getLatest()
|
||||||
j.setHandle(&cmd)
|
j.setHandle(&cmd)
|
||||||
err = j.start()
|
err = j.start()
|
||||||
|
|
|
@ -4,8 +4,13 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var bgProcAttr *syscall.SysProcAttr = &syscall.SysProcAttr{
|
||||||
|
Setpgid: true,
|
||||||
|
}
|
||||||
|
|
||||||
func findExecutable(path string, inPath, dirs bool) error {
|
func findExecutable(path string, inPath, dirs bool) error {
|
||||||
f, err := os.Stat(path)
|
f, err := os.Stat(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -5,8 +5,13 @@ package main
|
||||||
import (
|
import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"os"
|
"os"
|
||||||
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var bgProcAttr *syscall.SysProcAttr = &syscall.SysProcAttr{
|
||||||
|
CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP,
|
||||||
|
}
|
||||||
|
|
||||||
func findExecutable(path string, inPath, dirs bool) error {
|
func findExecutable(path string, inPath, dirs bool) error {
|
||||||
nameExt := filepath.Ext(path)
|
nameExt := filepath.Ext(path)
|
||||||
pathExts := filepath.SplitList(os.Getenv("PATHEXT"))
|
pathExts := filepath.SplitList(os.Getenv("PATHEXT"))
|
||||||
|
|
Loading…
Reference in New Issue