This commit is contained in:
bluepython508 committed 2026-10-22 12:27:19 +01:00
1 parent 3530afb854
commit 6903fcff27
2146 files changed
+112256 -190703

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
//go:build plan9
package neterror
import (
"errors"
"io"
"io/fs"
"strings"
)
// Reports whether err resulted from reading or writing to a closed or broken pipe.
func IsClosedPipeError(err error) bool {
// Libraries may also return root errors like fs.ErrClosed/io.ErrClosedPipe
// due to a closed socket.
// For a raw syscall error, check for error string containing "closed pipe",
// per the note set by the system: https://9p.io/magic/man2html/2/pipe
return errors.Is(err, fs.ErrClosed) ||
errors.Is(err, io.ErrClosedPipe) ||
strings.Contains(err.Error(), "closed pipe")
}