Commit dc146ac1 authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #7013 from ethereum-optimism/aj/close-all

op-program: Always close both sides of a file channel
parents 16b00d32 3fba1d9b
package io package io
import ( import (
"errors"
"io" "io"
"os" "os"
) )
...@@ -41,10 +42,7 @@ func (rw *ReadWritePair) Writer() *os.File { ...@@ -41,10 +42,7 @@ func (rw *ReadWritePair) Writer() *os.File {
} }
func (rw *ReadWritePair) Close() error { func (rw *ReadWritePair) Close() error {
if err := rw.r.Close(); err != nil { return errors.Join(rw.r.Close(), rw.w.Close())
return err
}
return rw.w.Close()
} }
// CreateBidirectionalChannel creates a pair of FileChannels that are connected to each other. // CreateBidirectionalChannel creates a pair of FileChannels that are connected to each other.
......
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