Commit 65f5091
Call SyscallConn() instead of Fd() to use file's fd
[os.File.SyscallConn] is the safer alternative to [os.File.Fd], without the pitfalls mentioned in Fd's doc comment.
The SyscallConn method is implemented on all platforms except Plan 9, where it returns [syscall.EPLAN9], which matches [errors.ErrUnsupported] and goes to the fallback path.1 parent 77b99f8 commit 65f5091
1 file changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
260 | 275 | | |
261 | 276 | | |
262 | 277 | | |
| |||
0 commit comments