mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-04 10:57:50 +08:00
Log stub events.
Doesn't seem to work though :(
This commit is contained in:
parent
0fc6c01077
commit
4d63220e14
|
@ -12,6 +12,7 @@ import (
|
||||||
"github.com/elves/elvish/util"
|
"github.com/elves/elvish/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var Logger = util.GetLogger("[stub] ")
|
||||||
var stubname = "elvish-stub"
|
var stubname = "elvish-stub"
|
||||||
|
|
||||||
type Stub struct {
|
type Stub struct {
|
||||||
|
@ -130,6 +131,7 @@ func relaySignals(reader io.Reader, sigch chan<- os.Signal) {
|
||||||
for {
|
for {
|
||||||
var signum int
|
var signum int
|
||||||
_, err := fmt.Fscanf(reader, "%d", &signum)
|
_, err := fmt.Fscanf(reader, "%d", &signum)
|
||||||
|
Logger.Println("signal:", signum, err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
sigch <- BadSignal{err}
|
sigch <- BadSignal{err}
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
|
@ -144,6 +146,7 @@ func relaySignals(reader io.Reader, sigch chan<- os.Signal) {
|
||||||
func wait(proc *os.Process, ch chan<- struct{}) {
|
func wait(proc *os.Process, ch chan<- struct{}) {
|
||||||
for {
|
for {
|
||||||
state, err := proc.Wait()
|
state, err := proc.Wait()
|
||||||
|
Logger.Println("wait:", state, err)
|
||||||
if err != nil || state.Exited() {
|
if err != nil || state.Exited() {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user