Skip to content

Commit

Permalink
fix: close stderr in [run_in_directory]
Browse files Browse the repository at this point in the history
Otherwise we're going to leak a file descriptor

Signed-off-by: Rudi Grinberg <[email protected]>

<!-- ps-id: 2bb24191-5229-4cc4-b689-43453c181f6b -->
  • Loading branch information
rgrinberg committed Jul 21, 2024
1 parent a129457 commit d1b1cf5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ocaml-lsp-server/src/ocaml_lsp_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,7 @@ let run_in_directory ~prog ~prog_is_quoted:_ ~args ~cwd ?stdin ?stdout ?stderr (
in
Unix.close stdin;
if should_close_stdout then Unix.close stdout;
Option.iter stderr ~f:Unix.close;
`Finished res
;;

Expand Down

0 comments on commit d1b1cf5

Please sign in to comment.