Remove stderr reading (caused bug)

This commit is contained in:
ppom 2023-10-18 12:00:00 +02:00
parent 3822e854b6
commit d35167b878

View File

@ -23,22 +23,10 @@ func cmdStdout(commandline []string) chan *string {
if err != nil { if err != nil {
logger.Fatalln("couldn't open stdout on command:", err) logger.Fatalln("couldn't open stdout on command:", err)
} }
stderr, err := cmd.StderrPipe()
if err != nil {
logger.Fatalln("couldn't open stderr on command:", err)
}
if err := cmd.Start(); err != nil { if err := cmd.Start(); err != nil {
logger.Fatalln("couldn't start command:", err) logger.Fatalln("couldn't start command:", err)
} }
defer stdout.Close() defer stdout.Close()
defer stderr.Close()
func() {
errscan := bufio.NewScanner(stderr)
for errscan.Scan() {
line := errscan.Text()
logger.Println(logger.WARN, "stderr:", line)
}
}()
scanner := bufio.NewScanner(stdout) scanner := bufio.NewScanner(stdout)
for scanner.Scan() { for scanner.Scan() {
line := scanner.Text() line := scanner.Text()