Skip to content

Commit

Permalink
close the /dev/urandom file descriptor at exit
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Dec 6, 2024
1 parent 3abb84a commit 0917c36
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rng/unix/urandom.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let create ?time:_ () =
let ic = In_channel.open_bin "/dev/urandom"
and mutex = Mutex.create ()
in
at_exit (fun () -> In_channel.close ic);
(ic, mutex)

let generate_into ~g:(ic, m) buf ~off len =
Expand Down

0 comments on commit 0917c36

Please sign in to comment.