fix: fix faulty syscall result/status code compares

This commit is contained in:
daniel committed 2026-10-13 07:15:05 +02:00
1 parent abfd9de8f6
commit a81298fb24
7 files changed
+19 -14

No files matched your search

+7
View File
@@ -60,6 +60,13 @@ inline const char* GetStatusText(StatusCode statusCode) {
}
}
// Map a raw syscall result to a StatusCode.
inline StatusCode StatusFromResult(long long rc) {
if (rc >= 0) return Success;
if (rc < -(long long)WouldBlock) return GenericFailure;
return (StatusCode)(-rc);
}
// Shared with C (libc.c), so no nullptr.
inline const char* GetStatusExplanationText(StatusCode statusCode) {
const char* explanationText[] = {