mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
daemon: Use O_CLOEXEC instead of Unix.set_close_on_exec.
In fact we already used O_CLOEXEC in daemon/inspect_fs_windows.c, meaning that the code wouldn't have compiled on OCaml 3.11. Thanks: Pino Toscano
This commit is contained in:
@@ -49,8 +49,7 @@ let map_block_devices ~return_md f =
|
||||
List.filter (
|
||||
fun dev ->
|
||||
try
|
||||
let fd = openfile ("/dev/" ^ dev) [O_RDONLY] 0 in
|
||||
Unix.set_close_on_exec fd; (* XXX *)
|
||||
let fd = openfile ("/dev/" ^ dev) [O_RDONLY; O_CLOEXEC] 0 in
|
||||
close fd;
|
||||
true
|
||||
with _ -> false
|
||||
|
||||
Reference in New Issue
Block a user