Kernel+LibC: Add some errno codes

Kernel now returns ENOMEM and other errnos, so we dont have to write
error messages
This commit is contained in:
Bananymous
2023-03-02 21:10:44 +02:00
parent 90a7268e5a
commit 52aa98ba25
16 changed files with 87 additions and 31 deletions

View File

@@ -197,7 +197,7 @@ namespace BAN
size_type new_bucket_count = BAN::Math::max<size_type>(bucket_count, m_buckets.size() * 2);
Vector<Vector<T>> new_buckets;
if (new_buckets.resize(new_bucket_count).is_error())
return Error::from_string("HashSet: Could not allocate memory");
return Error::from_errno(ENOMEM);
// NOTE: We have to copy the old keys to the new keys and not move
// since we might run out of memory half way through.
@@ -207,7 +207,7 @@ namespace BAN
{
size_type bucket_index = HASH()(key) % new_buckets.size();
if (new_buckets[bucket_index].push_back(key).is_error())
return Error::from_string("HashSet: Could not allocate memory");
return Error::from_errno(ENOMEM);
}
}