Commit 0c02280f authored by David du Colombier's avatar David du Colombier Committed by Brad Fitzpatrick

net: fix TestCloseError on Plan 9

Since CL 30614, TestCloseError is failing on Plan 9,
because File.Write now checks f.fd == badFd before
calling syscall.Write.

The f.fd == badFd check returns os.ErrClosed, while
syscall.Write returned a syscall.ErrorString error.

TestCloseError was failing because it expected a
syscall.ErrorString error.

We add a case in parseCloseError to handle the
os.ErrClosed case.

Fixes #17569.

Change-Id: I6b4d956d18ed6d3c2ac5211ffd50a4888f7521e1
Reviewed-on: https://go-review.googlesource.com/31872
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 1fcad293
......@@ -521,6 +521,10 @@ third:
if isPlatformError(nestedErr) {
return nil
}
switch nestedErr {
case os.ErrClosed: // for Plan 9
return nil
}
return fmt.Errorf("unexpected type on 3rd nested level: %T", nestedErr)
}
......
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