Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix false munmap error #4

Merged
merged 1 commit into from Aug 28, 2022
Merged

Fix false munmap error #4

merged 1 commit into from Aug 28, 2022

Conversation

Tearth
Copy link

@Tearth Tearth commented Aug 23, 2022

According to https://linux.die.net/man/2/munmap:

On success, munmap() returns 0, on failure -1, and errno is set (probably to EINVAL).

The condition in unmap_file function is inverted, munmap on success returns 0, so now it will always call perror. I've fixed it by comparing to 0, so hopefully will be ok now.

@jdart1 jdart1 merged commit b9672ac into jdart1:master Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants