fix: fix faulty syscall result/status code compares
This commit is contained in:
1 parent
abfd9de8f6
commit
a81298fb24
7 files changed
+19
-14
No files matched your search
@@ -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[] = {
|
||||
|
||||
Reference in new issue
Block a user