We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 192ffb2 + dc060ec commit cff94ccCopy full SHA for cff94cc
ocaml/xenguest/xenguest_main.ml
@@ -33,7 +33,7 @@ let file_descr_of_int (x: int) : Unix.file_descr = Obj.magic x
33
let int_of_file_descr (x: Unix.file_descr) : int = Obj.magic x
34
35
let close_all_fds_except (fds: Unix.file_descr list) =
36
- let all_open = Sys.readdir (sprintf "/proc/%d/fd" (Unix.getpid ())) in
+ let all_open = Sys.readdir "/proc/self/fd" in
37
let all_open = List.map int_of_string (Array.to_list all_open) in
38
let all_open = List.map file_descr_of_int all_open in
39
let to_close = set_difference all_open fds in
0 commit comments