Renamed writeBroadcaster.Close() to CloseWriters().
This commit is contained in:
parent
75ba07cb3a
commit
a83d87abd4
3 changed files with 6 additions and 6 deletions
|
@ -161,14 +161,14 @@ func (container *Container) startPty() error {
|
|||
|
||||
// Copy the PTYs to our broadcasters
|
||||
go func() {
|
||||
defer container.stdout.Close()
|
||||
defer container.stdout.CloseWriters()
|
||||
Debugf("[startPty] Begin of stdout pipe")
|
||||
io.Copy(container.stdout, stdoutMaster)
|
||||
Debugf("[startPty] End of stdout pipe")
|
||||
}()
|
||||
|
||||
go func() {
|
||||
defer container.stderr.Close()
|
||||
defer container.stderr.CloseWriters()
|
||||
Debugf("[startPty] Begin of stderr pipe")
|
||||
io.Copy(container.stderr, stderrMaster)
|
||||
Debugf("[startPty] End of stderr pipe")
|
||||
|
@ -374,10 +374,10 @@ func (container *Container) monitor() {
|
|||
if err := container.releaseNetwork(); err != nil {
|
||||
log.Printf("%v: Failed to release network: %v", container.Id, err)
|
||||
}
|
||||
if err := container.stdout.Close(); err != nil {
|
||||
if err := container.stdout.CloseWriters(); err != nil {
|
||||
Debugf("%s: Error close stdout: %s", container.Id, err)
|
||||
}
|
||||
if err := container.stderr.Close(); err != nil {
|
||||
if err := container.stderr.CloseWriters(); err != nil {
|
||||
Debugf("%s: Error close stderr: %s", container.Id, err)
|
||||
}
|
||||
if err := container.Unmount(); err != nil {
|
||||
|
|
2
utils.go
2
utils.go
|
@ -242,7 +242,7 @@ func (w *writeBroadcaster) Write(p []byte) (n int, err error) {
|
|||
return len(p), nil
|
||||
}
|
||||
|
||||
func (w *writeBroadcaster) Close() error {
|
||||
func (w *writeBroadcaster) CloseWriters() error {
|
||||
w.mu.Lock()
|
||||
defer w.mu.Unlock()
|
||||
for writer := range w.writers {
|
||||
|
|
|
@ -122,7 +122,7 @@ func TestWriteBroadcaster(t *testing.T) {
|
|||
t.Errorf("Buffer contains %v", bufferC.String())
|
||||
}
|
||||
|
||||
writer.Close()
|
||||
writer.CloseWriters()
|
||||
}
|
||||
|
||||
type devNullCloser int
|
||||
|
|
Loading…
Add table
Reference in a new issue