···115115 (* This should ensure that all children processes are killed before we cleanup the pipes*)
116116 Flock.join_after @@ fun () ->
117117 let pid =
118118- Picos_io.Unix.create_process_env
119119- cmd
120120- (cmd :: args |> Array.of_list)
121121- (Unix.environment ())
122122- stdin_o
123123- stdout_i
124124- stderr_i
118118+ Picos_io.Unix.create_process_env
119119+ cmd
120120+ (cmd :: args |> Array.of_list)
121121+ (Unix.environment ())
122122+ stdin_o
123123+ stdout_i
124124+ stderr_i
125125 in
126126+ let prom = Flock.fork_as_promise (fun () -> Picos_io.Unix.waitpid [] pid) in
126127 (* Close unused pipe ends in the parent process *)
127128 Unix.close stdout_i;
128129 Unix.close stdin_o;
···133134 let stderr_prom = read_fd_to_end stderr_o in
134135 let stdout = Promise.await stdout_prom in
135136 let stderr = Promise.await stderr_prom in
136136- Control.yield ();
137137- let prom = Flock.fork_as_promise (fun () -> Picos_io.Unix.waitpid [] pid) in
138137 let code, status = Promise.await prom in
139138 (* let stderr = read_fd_to_end stderr_i in *)
140139 (* let stdout= ""in *)