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

correct error checks for pthread functions #2788

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

correct error checks for pthread functions #2788

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.1
Reported for operating system, platform: Linux, All

Comments on the original bug report:

On 2018-01-11 07:16:16 +0000, Andreas Wiese wrote:

Created attachment 3131
fix pthread return checks

The pthread threading implementation does some error checks wrong. Nearly all pthread_*() functions returning int on success are defined to "return zero. Otherwise, an error number is returned to indicate the error", followed by a list of error conditions and their error values as "errno"s. This does not say anything about the sign of the error codes and indeed, most libc implementations have positive errnos. Thus correct error checking should not test for ret < 0, but for ret != 0, as otherwise the error check might be noneffective depending on used libc implementation.

On 2018-02-18 04:59:07 +0000, Ryan C. Gordon wrote:

This patch is now https://hg.libsdl.org/SDL/rev/ecddbd9fe6b5, thanks!

--ryan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant