The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Ignore ECONNRESET on close

FreeBSD returns ECONNRESET in certain (unclear) circumstances, but it
does still close the FD successfully. If you care about this case, you
should probably use `shutdown` instead and check for it there.

Python and Ruby at least both explicitly check for and ignore this error
too.

+11 -1
+4
vendor/opam/eio/lib_eio/tests/dscheck/unix.ml
··· 1 + type error = ECONNRESET 2 + 3 + exception Unix_error of error * string * string 4 + 1 5 type file_descr = [`Open | `Closed] Atomic.t 2 6 3 7 let make () = Atomic.make `Open
+7 -1
vendor/opam/eio/lib_eio/unix/rcfd.ml
··· 98 98 None 99 99 100 100 let close_fd fd = 101 - Eio.Private.Trace.with_span "close" (fun () -> Unix.close fd) 101 + Eio.Private.Trace.with_span "close" (fun () -> 102 + try 103 + Unix.close fd 104 + with Unix.Unix_error (ECONNRESET, _, _) -> 105 + (* For FreeBSD. See https://github.com/ocaml-multicore/eio/issues/786 *) 106 + () 107 + ) 102 108 103 109 (* Note: we could simplify this a bit by incrementing [t.ops], as [remove] does. 104 110 However, that makes dscheck too slow. *)