Browse code

Don't forward SIGPIPE from client to container

Signed-off-by: Brian Goff <cpuguy83@gmail.com>

Brian Goff authored on 2016/03/19 05:50:18
Showing 3 changed files
... ...
@@ -21,7 +21,7 @@ func (cli *DockerCli) forwardAllSignals(cid string) chan os.Signal {
21 21
 	signal.CatchAll(sigc)
22 22
 	go func() {
23 23
 		for s := range sigc {
24
-			if s == signal.SIGCHLD {
24
+			if s == signal.SIGCHLD || s == signal.SIGPIPE {
25 25
 				continue
26 26
 			}
27 27
 			var sig string
... ...
@@ -14,6 +14,8 @@ const (
14 14
 	SIGCHLD = syscall.SIGCHLD
15 15
 	// SIGWINCH is a signal sent to a process when its controlling terminal changes its size
16 16
 	SIGWINCH = syscall.SIGWINCH
17
+	// SIGPIPE is a signal sent to a process when a pipe is written to before the other end is open for reading
18
+	SIGPIPE = syscall.SIGPIPE
17 19
 	// DefaultStopSignal is the syscall signal used to stop a container in unix systems.
18 20
 	DefaultStopSignal = "SIGTERM"
19 21
 )
... ...
@@ -11,6 +11,7 @@ import (
11 11
 const (
12 12
 	SIGCHLD  = syscall.Signal(0xff)
13 13
 	SIGWINCH = syscall.Signal(0xff)
14
+	SIGPIPE  = syscall.Signal(0xff)
14 15
 	// DefaultStopSignal is the syscall signal used to stop a container in windows systems.
15 16
 	DefaultStopSignal = "15"
16 17
 )