Skip to content

[3.12] gh-113343: Fix error check on mmap(2) (GH-113342)#113374

Merged
pablogsal merged 1 commit intopython:3.12from
miss-islington:backport-6b70c3d-3.12
Dec 21, 2023
Merged

[3.12] gh-113343: Fix error check on mmap(2) (GH-113342)#113374
pablogsal merged 1 commit intopython:3.12from
miss-islington:backport-6b70c3d-3.12

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented Dec 21, 2023

Fix error check on mmap(2)

It should check MAP_FAILED instead of NULL for error.

On mmap(2) man page:

RETURN VALUE
On success, mmap() returns a pointer to the mapped area.
On error, the value MAP_FAILED (that is, (void *) -1) is
returned, and errno is set to indicate the error.
(cherry picked from commit 6b70c3d)

Co-authored-by: Namhyung Kim namhyung@gmail.com

Fix error check on mmap(2)

It should check MAP_FAILED instead of NULL for error.

On mmap(2) man page:

  RETURN VALUE
       On success, mmap() returns a pointer to the mapped area.
       On error, the value MAP_FAILED (that is, (void *) -1) is
       returned, and errno is set to indicate the error.
(cherry picked from commit 6b70c3d)

Co-authored-by: Namhyung Kim <namhyung@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants