Skip to content

Commit 3942bad

Browse files
authored
Merge pull request #343 from Leonidas-from-XIV/fix-restoring-stderr
Fix restoring stderr correctly
2 parents 01818a1 + a140987 commit 3942bad

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#### Fixed
1212

13+
- Fix accidental redirect of stderr to stdout (#343, @Leonidas-from-XIV)
14+
1315
#### Removed
1416

1517
#### Security

lib/top/mdx_top.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type directive = Directory of string | Load of string
2222

2323
let redirect ~f =
2424
let stdout_backup = Unix.dup Unix.stdout in
25-
let stderr_backup = Unix.dup Unix.stdout in
25+
let stderr_backup = Unix.dup Unix.stderr in
2626
let filename = Filename.temp_file "ocaml-mdx" "stdout" in
2727
let fd_out =
2828
Unix.openfile filename Unix.[ O_WRONLY; O_CREAT; O_TRUNC ] 0o600

0 commit comments

Comments
 (0)