File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -98,7 +98,13 @@ let get t =
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. *)
You can’t perform that action at this time.
0 commit comments