Skip to content

socketpair: clear 'err' when retrying due to EINTR - #20809

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/wakeup-eintr
Closed

bagder wants to merge 1 commit into
masterfrom
bagder/wakeup-eintr

Conversation

@bagder

@bagder bagder commented Mar 3, 2026

Copy link
Copy Markdown
Member

If the first write was interrupted by a signal and a subsequent write succeeds, the function would still erroneously return EINTR.

Found by Codex Security

If the first write was interrupted by a signal and a subsequent write
succeeds, the function would still erroneously return EINTR.

Found by Codex Security
@github-actions github-actions Bot added the name lookup DNS and related tech label Mar 3, 2026
@bagder
bagder requested a review from Copilot March 4, 2026 10:09
@bagder
bagder marked this pull request as ready for review March 4, 2026 10:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Curl_wakeup_signal() so it does not incorrectly return EINTR after a successful retry when the initial wakeup_write() was interrupted by a signal. This impacts the wakeup mechanism used by curl_multi_wakeup() / async resolver notification paths.

Changes:

  • Reset err at the start of each retry loop iteration in Curl_wakeup_signal() so a successful retry returns 0 rather than a stale EINTR.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@bagder bagder closed this in e47b6e6 Mar 6, 2026
@bagder
bagder deleted the bagder/wakeup-eintr branch March 6, 2026 21:50
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
If the first write was interrupted by a signal and a subsequent write
succeeds, the function would still erroneously return EINTR.

Found by Codex Security
Closes curl#20809
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

name lookup DNS and related tech

Development

Successfully merging this pull request may close these issues.

2 participants