From f4f2e55ee6bf63cff35d196c6026719e639cb24a Mon Sep 17 00:00:00 2001 From: pjht Date: Sun, 3 Nov 2024 11:06:43 -0600 Subject: [PATCH] mikros: Fix reporting 0 bytes read when STDOUT/ERR is written with no open FD --- library/std/src/sys/pal/mikros/stdio.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/sys/pal/mikros/stdio.rs b/library/std/src/sys/pal/mikros/stdio.rs index 94f32d106b1..3d941fb5025 100644 --- a/library/std/src/sys/pal/mikros/stdio.rs +++ b/library/std/src/sys/pal/mikros/stdio.rs @@ -46,7 +46,7 @@ fn write(&mut self, buf: &[u8]) -> io::Result { //} //Ok(buf.len()) let Some(fd) = *STDOUT_FD.get().unwrap() else { - return Ok(0); + return Ok(buf.len()); }; let file = File { fs_pid: fd.0, fd: fd.1 }; let res = file.write(buf); @@ -74,7 +74,7 @@ fn write(&mut self, buf: &[u8]) -> io::Result { //} //Ok(buf.len()) let Some(fd) = *STDERR_FD.get().unwrap() else { - return Ok(0); + return Ok(buf.len()); }; let file = File { fs_pid: fd.0, fd: fd.1 }; let res = file.write(buf);