Warning about atomic-ness of a deprecated `pipe2` on macOS
warning: use of deprecated item 'nix::unistd::pipe2': pipe2(2) is not actually atomic on these platforms. Use pipe(2) and fcntl(2) instead
--> src/lib/shell/pipe_exec/pipes.rs:11:9
|
11 | unistd::pipe2(OFlag::O_CLOEXEC).map_err(PipelineError::CreatePipeError)?;
| ^^^^^^^^^^^^^
|
= note: #[warn(deprecated)] on by default
I'd be willing to fix the warning, but I am not sure what exactly the warning means. Would it be enough to do
let (a, b) = unistd::pipe().map_err(PipelineError::CreatePipeError)?;
fcntl(a, FcntlArg::F_SETFL(OFlag::O_CLOEXEC)).map_err(PipelineError::CreatePipeError)?;
fcntl(b, FcntlArg::F_SETFL(OFlag::O_CLOEXEC)).map_err(PipelineError::CreatePipeError)?;
?