We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f26d70d + 1766568 commit f195295Copy full SHA for f195295
lib_eio/tests/dscheck/unix.ml
@@ -1,3 +1,7 @@
1
+type error = ECONNRESET
2
+
3
+exception Unix_error of error * string * string
4
5
type file_descr = [`Open | `Closed] Atomic.t
6
7
let make () = Atomic.make `Open
lib_eio/unix/rcfd.ml
@@ -98,7 +98,13 @@ let get t =
98
None
99
100
let close_fd fd =
101
- Eio.Private.Trace.with_span "close" (fun () -> Unix.close fd)
+ 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
+ )
108
109
(* Note: we could simplify this a bit by incrementing [t.ops], as [remove] does.
110
However, that makes dscheck too slow. *)
0 commit comments