From 59e5f58d1fc34d197ebd2091ba6f3cc3eff6a48f Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Wed, 1 May 2024 13:52:11 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A1=20Correct=20safety=20comment=20abo?= =?UTF-8?q?ut=20FD=20from=20`--ready-fd`=20option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bin/busd.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/busd.rs b/src/bin/busd.rs index 8d0e138..bc2b2cc 100644 --- a/src/bin/busd.rs +++ b/src/bin/busd.rs @@ -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")?; }