
If we send a process to foreground while the headless instance may get a SIGTTOU/SIGTTIN, if not ignored this signal will stop the headless. It's not clear why this only happens the second time we do this but that's how it is. Also removes the direct syscall to TIOCSPGRP and lets the go runtime do it instead. Fixes #1279
17 lines
300 B
Go
17 lines
300 B
Go
// +build linux darwin
|
|
|
|
package gdbserial
|
|
|
|
import (
|
|
"os/signal"
|
|
"syscall"
|
|
)
|
|
|
|
func sysProcAttr(foreground bool) *syscall.SysProcAttr {
|
|
return &syscall.SysProcAttr{Setpgid: true, Pgid: 0, Foreground: foreground}
|
|
}
|
|
|
|
func foregroundSignalsIgnore() {
|
|
signal.Ignore(syscall.SIGTTOU, syscall.SIGTTIN)
|
|
}
|