Skip to content

Error Handling Code Paths #238

Description

@dthain

There are several points in kernel code where the internal interfaces prevent a proper passing of error codes.

For example struct dirent * fs_resolve( const *path) looks pretty, but has no way of returning a kerror to indicate why a resolve failed. As a result, the relevant syscall handlers assume a default of KERROR_NOT_FOUND which is not ideal.

To fix this, rework the following interfaces (and possibly others) to return an error code as the primary result, and fill in the new data structure via a doubly-indirect pointer.

For example, this:

struct dirent * fs_resolve( const char *path );

Should become this:

int fs_resolve( const char *path, struct dirent **d );

Similar comments apply to fs_mkdir fs_traverse and so forth. This requires fixing both the generic filesystem interface as well as the underlying filesystem drivers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions