loliOS icon indicating copy to clipboard operation
loliOS copied to clipboard

Correctly propagate error codes

Open apsun opened this issue 3 years ago • 0 comments

A lot of code in the kernel uses the following pattern:

if (fn() < 0) {
    return -1;
}

This discards the error code and replaces it with a generic -1. If we ever want to start returning proper error codes like EINVAL, ENOMEM, etc, we need to replace this with:

if ((ret = fn()) < 0) {
    return ret;
}

apsun avatar Oct 17 '21 18:10 apsun