Refactor C psutil_pid_exists(), fixes #783 and #855 #908

Merged
merged 9 commits into from Oct 5, 2016

Conversation

Projects
None yet
1 participant
@giampaolo
Owner

giampaolo commented Oct 5, 2016

This function wasn't properly checking the errno. As such it could erroneously raise NoSuchProcess or AccessDenied or mask the real OSError or RuntimeError for the following methods:

All BSDs: open_files()
FreeBSD: exe(), cwd(), connections()
NetBSD: exe(), num_fds()
OpenBSD: num_fds(), connections()
OSX: exe(), memory_full_info(), memory_maps(), threads(), connections()

Furthermore, this is supposed to fix #783 where Process.status() erroneously return running for zombie processes.

This also refactor psutil_pid_exists() which was unnecessarily replicated for different platforms and move it in a single place for all POSIX systems.

This also super-seeds #855.

@giampaolo giampaolo changed the title from Refactor C psutil_pid_exists() to Refactor C psutil_pid_exists(), fixes #783 and #855 Oct 5, 2016

@giampaolo giampaolo merged commit ae0143b into master Oct 5, 2016

0 of 3 checks passed

codacy/pr Hang in there, Codacy is reviewing your Pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details

@giampaolo giampaolo deleted the refactor-c-pid-exists branch Oct 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment