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

@@ -234,10 +234,7 @@ void filemanager_read_system_configuration(FileManagerState* fm);
// Map a raw syscall result (kernel StatusCodes are negative) to a userspace
// montauk::StatusCodes. Non-negative results (handles, counts) are Success.
inline montauk::StatusCode filemanager_status_from_result(int rc) {
if (rc >= 0) return montauk::Success;
int code = -rc;
if (code > montauk::OutOfMemory) return montauk::GenericFailure;
return (montauk::StatusCode)code;
return montauk::StatusFromResult(rc);
}
// The path itself may not be modified. Falling back to copy + delete after a