Commit 1c655365 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer: closed pipe is caught [GH-875]

parent 868a64eb
......@@ -20,6 +20,8 @@ BUG FIXES:
* core: Fix crash case if blank parameters are given to Packer. [GH-832]
* core: Fix crash if big file uploads are done. [GH-897]
* core: Fix crash if machine-readable output is going to a closed
pipe. [GH-875]
* builder/docker: user variables work properly. [GH-777]
* builder/qemu: reboots are now possible in provisioners. [GH-864]
* builder/virtualbox,vmware: iso\_checksum is not required if the
......
......@@ -11,6 +11,7 @@ import (
"runtime"
"strings"
"sync"
"syscall"
"time"
"unicode"
)
......@@ -282,6 +283,11 @@ func (u *MachineReadableUi) Machine(category string, args ...string) {
_, err := fmt.Fprintf(u.Writer, "%d,%s,%s,%s\n", now.Unix(), target, category, argsString)
if err != nil {
panic(err)
if err == syscall.EPIPE {
// Ignore epipe errors because that just means that the file
// is probably closed or going to /dev/null or something.
} else {
panic(err)
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment