Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix syscall error handling #303

Merged
merged 2 commits into from
Dec 22, 2023

Conversation

visitorckw
Copy link
Collaborator

Several system call implementations lack proper error handling, potentially returning 0 even when an error occurs. This patch addresses the issue by introducing a proper check to ensure correct return values when errors occur.

The current implementation of syscall_write lacks proper error
handling, potentially returning 0 even when an error occurs. This fix
introduces a check for fwrite errors and updates the return value to
-1 in case of an error.
The current implementation of syscall_close lacks proper error
handling, potentially returning 0 even when an error occurs. This fix
introduces a check for fclose errors and updates the return value to
-1 in case of an error.
@jserv jserv requested a review from qwe661234 December 22, 2023 12:56
@jserv jserv merged commit c32861a into sysprog21:master Dec 22, 2023
5 checks passed
@jserv
Copy link
Contributor

jserv commented Dec 22, 2023

Thank @visitorckw for contributing!

@visitorckw visitorckw deleted the fix-syscall-error-handling branch December 22, 2023 13:10
vestata pushed a commit to vestata/rv32emu that referenced this pull request Jan 24, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants