Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust: check range and add type invariant to Error
We will need to make sure that no Error with out of range error code can be constructed. This commit 1. Adds a constructor method "new()" to Error with errno check 2. Uses the "new()" method to create Error in from_kernel_errno() 3. Provides a unchecked version from_kernel_errno_unchecked() And when an invalid errno is found, it will 1) Print a warning. 2) Convert it to EINVAL. Signed-off-by: Fox Chen <[email protected]>
- Loading branch information