Skip to content

Commit

Permalink
💡 Correct safety comment about FD from --ready-fd option
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeeshan Ali Khan committed May 1, 2024
1 parent 8d35952 commit 59e5f58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bin/busd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ async fn main() -> Result<()> {

#[cfg(unix)]
if let Some(fd) = args.ready_fd {
// SAFETY: accessing `ready_fd` in any other context aside from `main` is disallowed, so
// there is only one owner for this file descriptor.
// SAFETY: We don't have any way to know if the fd is valid or not. The parent process is
// responsible for passing a valid fd.
let mut ready_file = unsafe { File::from_raw_fd(fd) };
ready_file.write_all(b"READY=1\n")?;
}
Expand Down

0 comments on commit 59e5f58

Please sign in to comment.