Skip to content

Commit

Permalink
Revert "Safer timeout computation."
Browse files Browse the repository at this point in the history
This reverts commit 7f2f464.
  • Loading branch information
toots committed Feb 4, 2024
1 parent b5a4e7a commit 7eb1968
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/cry.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ let poll r w timeout =
match timeout with
| x when x < 0. -> Poll.Timeout.never
| 0. -> Poll.Timeout.immediate
| x ->
let frac, int = modf x in
let int = Int64.mul (Int64.of_float int) 1_000_000_000L in
let frac = Int64.of_float (frac *. 1_000_000_000.) in
let timeout = Int64.add int frac in
Poll.Timeout.after timeout
| x -> Poll.Timeout.after (Int64.of_float (x *. 1_000_000_000.))
in
let poll = Poll.create () in
List.iter (fun fd -> Poll.set poll fd Poll.Event.read) r;
Expand Down

0 comments on commit 7eb1968

Please sign in to comment.