Title: selectmodule.c: errno < 0 comparison is always false · Issue #146205 · python/cpython · GitHub
Open Graph Title: selectmodule.c: errno < 0 comparison is always false · Issue #146205 · python/cpython
X Title: selectmodule.c: errno < 0 comparison is always false · Issue #146205 · python/cpython
Description: Bug report Bug description: Summary Multiple sites in Modules/selectmodule.c check if (errno < 0) after close/epoll_ctl calls. Since errno is an int set to positive values (POSIX), this check is always false. Close errors are silently sw...
Open Graph Description: Bug report Bug description: Summary Multiple sites in Modules/selectmodule.c check if (errno < 0) after close/epoll_ctl calls. Since errno is an int set to positive values (POSIX), this check is al...
X Description: Bug report Bug description: Summary Multiple sites in Modules/selectmodule.c check if (errno < 0) after close/epoll_ctl calls. Since errno is an int set to positive values (POSIX), this check is...
Opengraph URL: https://github.com/python/cpython/issues/146205
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"selectmodule.c: errno \u003c 0 comparison is always false","articleBody":"# Bug report\n\n### Bug description:\n\n## Summary\n\nMultiple sites in `Modules/selectmodule.c` check `if (errno \u003c 0)` after close/epoll_ctl calls. Since `errno` is an `int` set to positive values (POSIX), this check is always false. Close errors are silently swallowed.\n\n## Fix\n\nChange `if (errno \u003c 0)` to `if (retval \u003c 0)` (check the return value, not errno directly).\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-146206\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/aisk","@type":"Person","name":"aisk"},"datePublished":"2026-03-20T12:44:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/146205/cpython/issues/146205"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3ad2deb7-1ae7-20e6-267b-469b13e5c5fc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DD92:346934:F931E9:151080E:6A50748E |
| html-safe-nonce | 923aa822f47c0d9774591457c4b3fa347439905217a1778423a575b13291d6ed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDkyOjM0NjkzNDpGOTMxRTk6MTUxMDgwRTo2QTUwNzQ4RSIsInZpc2l0b3JfaWQiOiI0NTk0MTg2NjM1NTI0OTk0MTkwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8150093504fa36edd29a2cf8eeb06d907be27fe890f49d48e6e5ce5fc1aca44e |
| hovercard-subject-tag | issue:4107681414 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/146205/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5b6698d046a1b504809e9a952d41c24738a7f32132c8b5e61684f418557d4ed6/python/cpython/issues/146205 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5b6698d046a1b504809e9a952d41c24738a7f32132c8b5e61684f418557d4ed6/python/cpython/issues/146205 |
| og:image:alt | Bug report Bug description: Summary Multiple sites in Modules/selectmodule.c check if (errno < 0) after close/epoll_ctl calls. Since errno is an int set to positive values (POSIX), this check is al... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aisk |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width