diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-12-22 21:35:42 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-12-22 21:35:42 +0100 |
commit | d2cf661e547cbf901d2d643f0ff29c2f205d599a (patch) | |
tree | f11a94104c3ebfb84d907e3d4c947dcdbacbadf8 | |
parent | 6a938e20abc6c4b61683db447f912f67482f4779 (diff) |
Fixed reported error and logging.v0.1.8
-rw-r--r-- | golib/eows/eows-out.go | 8 | ||||
-rw-r--r-- | golib/eows/eows-signal.go | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/golib/eows/eows-out.go b/golib/eows/eows-out.go index 2a6b110..6f6706c 100644 --- a/golib/eows/eows-out.go +++ b/golib/eows/eows-out.go @@ -24,13 +24,13 @@ func (e *ExecOverWS) cmdPumpStdout(r io.Reader, done chan struct{}) { // else use default sc.ScanLines if e.OutSplit == SplitChar { - sc.Split(scanBlocks) + sc.Split(scanBlocks) } for sc.Scan() { e.OutputCB(e, sc.Text(), "") } - if sc.Err() != nil { + if sc.Err() != nil && !strings.Contains(sc.Err().Error(), "file already closed") { e.logError("stdout scan: %v", sc.Err()) } @@ -46,13 +46,13 @@ func (e *ExecOverWS) cmdPumpStderr(r io.Reader) { // else use default sc.ScanLines if e.OutSplit == SplitChar { - sc.Split(scanBlocks) + sc.Split(scanBlocks) } for sc.Scan() { e.OutputCB(e, "", sc.Text()) } - if sc.Err() != nil { + if sc.Err() != nil && !strings.Contains(sc.Err().Error(), "file already closed") { e.logError("stderr scan: %v", sc.Err()) } } diff --git a/golib/eows/eows-signal.go b/golib/eows/eows-signal.go index 5db5366..f48279a 100644 --- a/golib/eows/eows-signal.go +++ b/golib/eows/eows-signal.go @@ -43,6 +43,6 @@ func (e *ExecOverWS) Signal(signal string) error { return fmt.Errorf("Cannot retrieve process") } - fmt.Printf("SEND signal %v to proc %v\n", sig, e.proc.Pid) + e.logDebug("SEND signal %v to proc %v", sig, e.proc.Pid) return e.proc.Signal(sig) } |