Skip to content

Commit

Permalink
mock wait4 on Android using waitpid like on win32 (#752)
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoRFS authored and aantron committed Dec 14, 2019
1 parent ee191b5 commit 19cf913
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/unix/lwt_unix.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2242,7 +2242,7 @@ let has_wait4 = not Sys.win32
external stub_wait4 : Unix.wait_flag list -> int -> int * Unix.process_status * resource_usage = "lwt_unix_wait4"

let do_wait4 flags pid =
if Sys.win32 then
if Sys.win32 || Lwt_config.android then
let pid, status = Unix.waitpid flags pid in
(pid, status, { ru_utime = 0.0; ru_stime = 0.0 })
else
Expand Down Expand Up @@ -2312,7 +2312,7 @@ let waitpid =

let wait4 flags pid =
install_sigchld_handler ();
if Sys.win32 then
if Sys.win32 || Lwt_config.android then
Lwt.return (do_wait4 flags pid)
else
if List.mem Unix.WNOHANG flags then
Expand Down

0 comments on commit 19cf913

Please sign in to comment.