rwcancel: use ordinary os.ErrClosed instead of custom error

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2021-05-20 17:56:36 +02:00
parent a9b377e9e1
commit 50d779833e

View file

@ -89,7 +89,7 @@ func (rw *RWCancel) Read(p []byte) (n int, err error) {
return n, err
}
if !rw.ReadyRead() {
return 0, errors.New("fd closed")
return 0, os.ErrClosed
}
}
}
@ -101,7 +101,7 @@ func (rw *RWCancel) Write(p []byte) (n int, err error) {
return n, err
}
if !rw.ReadyWrite() {
return 0, errors.New("fd closed")
return 0, os.ErrClosed
}
}
}