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

Incorrect use of the kill($pid, 0) idiom. #108

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

Incorrect use of the kill($pid, 0) idiom. #108

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 2.0
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2008-09-25 19:27:29 +0000, Michael Stone wrote:

To determine whether a pid is occupied with the kill(pid, 0) idiom, you have to test

#include <signal.h>
#include <errno.h>
kill(pid, 0) < 0 && errno == ESRCH

not just

#include <signal.h>
kill(pid, 0) < 0

otherwise you get incorrect results when pid is running as a different user (causing kill(pid, 0) to return -1 + EPERM).

src/audio/alsa/SDL_alsa_audio.c is certainly affected by this bug in both 1.2.13 and 1.3-trunk. It probably occurs in other places as well.

On 2009-02-16 21:18:19 +0000, Sam Lantinga wrote:

Thanks, this is fixed in revision 4433.

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