Browse Source

Close the containers stdin when the process dies

Guillaume J. Charmes 12 years ago
parent
commit
4760749402
1 changed files with 5 additions and 0 deletions
  1. 5 0
      container.go

+ 5 - 0
container.go

@@ -382,6 +382,11 @@ func (container *Container) monitor() {
 	if err := container.releaseNetwork(); err != nil {
 		log.Printf("%v: Failed to release network: %v", container.Id, err)
 	}
+	if container.Config.OpenStdin {
+		if err := container.stdin.Close(); err != nil {
+			Debugf("%s: Error close stdin: %s", container.Id, err)
+		}
+	}
 	if err := container.stdout.Close(); err != nil {
 		Debugf("%s: Error close stdout: %s", container.Id, err)
 	}