diff options
Diffstat (limited to 'otherlibs/unix/wait.c')
-rw-r--r-- | otherlibs/unix/wait.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/otherlibs/unix/wait.c b/otherlibs/unix/wait.c index b660a75e4..5d74b8380 100644 --- a/otherlibs/unix/wait.c +++ b/otherlibs/unix/wait.c @@ -15,6 +15,7 @@ #include <mlvalues.h> #include <alloc.h> +#include <fail.h> #include <memory.h> #include <signals.h> #include "unixsupport.h" @@ -60,7 +61,7 @@ static value alloc_process_status(int pid, int status) return res; } -CAMLprim value unix_wait(void) +CAMLprim value unix_wait(value unit) { int pid, status; @@ -83,11 +84,11 @@ static int wait_flag_table[] = { CAMLprim value unix_waitpid(value flags, value pid_req) { - int pid, status; - + int pid, status, cv_flags; + + cv_flags = convert_flag_list(flags, wait_flag_table); enter_blocking_section(); - pid = waitpid(Int_val(pid_req), &status, - convert_flag_list(flags, wait_flag_table)); + pid = waitpid(Int_val(pid_req), &status, cv_flags); leave_blocking_section(); if (pid == -1) uerror("waitpid", Nothing); return alloc_process_status(pid, status); |