From 0b3be2d190ac2c9b0a7c7449b7f9df7dce7170b6 Mon Sep 17 00:00:00 2001
From: 4lDO2 <4lDO2@protonmail.com>
Date: Mon, 15 Jul 2024 16:38:53 +0200
Subject: [PATCH] Write correct value to kernel when exiting thread.

---
 redox-rt/src/thread.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/redox-rt/src/thread.rs b/redox-rt/src/thread.rs
index 19b3efc6..0a369511 100644
--- a/redox-rt/src/thread.rs
+++ b/redox-rt/src/thread.rs
@@ -52,6 +52,6 @@ pub fn exit_this_thread() -> ! {
     let thread_fd = RtTcb::current().thread_fd();
     // TODO: modify interface so it writes directly to the thread fd?
     let status_fd = syscall::dup(**thread_fd, b"status").unwrap();
-    syscall::write(status_fd, &0_usize.to_ne_bytes()).unwrap();
+    syscall::write(status_fd, &usize::MAX.to_ne_bytes()).unwrap();
     unreachable!()
 }
-- 
GitLab