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 28, 2024
1 parent a129457 commit 2d2610c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Unreelased
# Unreleased

## Fixes

- Kill unnecessary ocamlformat processes with sigterm rather than sigint or
sigkill (#1343)

- Fix fd leak in running external processes for preprocessing (#1349)

# 1.18.0

## Features
Expand Down
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 2d2610c

Please sign in to comment.