Skip to content

libutil: Fix writeFull to respect allowInterrupts#15319

Merged
xokdvium merged 1 commit intoNixOS:masterfrom
xokdvium:fix-interrupts-write-full
Feb 23, 2026
Merged

libutil: Fix writeFull to respect allowInterrupts#15319
xokdvium merged 1 commit intoNixOS:masterfrom
xokdvium:fix-interrupts-write-full

Conversation

@xokdvium
Copy link
Contributor

@xokdvium xokdvium commented Feb 23, 2026

Motivation

c0e849b broke interrupt handling since writeFull started throwing Interrupted even when allowInterrupts was false. This would lead to exceptions leaking out when they must not (for example during progress bar shutdown).

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@xokdvium xokdvium requested a review from edolstra as a code owner February 23, 2026 12:32
@xokdvium xokdvium requested review from Ericson2314 and removed request for edolstra February 23, 2026 12:32
c0e849b broke interrupt handling since
writeFull started throwing Interrupted even when allowInterrupts was false.
This would lead to exceptions leaking out when they must not (for example during
progress bar shutdown).
@xokdvium xokdvium force-pushed the fix-interrupts-write-full branch from 91589d7 to 658c775 Compare February 23, 2026 12:34
Comment on lines 77 to +88
/**
* Platform-specific write from a buffer.
*
* Thin wrapper around ::write (Unix) or WriteFile (Windows).
* Handles EINTR on Unix.
*
* @param fd The file descriptor to write to
* @param buffer The buffer to write from
* @return The number of bytes actually written
* @throws SystemError on failure
*/
size_t write(Descriptor fd, std::span<const std::byte> buffer);
size_t write(Descriptor fd, std::span<const std::byte> buffer, bool allowInterrupts);
Copy link
Member

Choose a reason for hiding this comment

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

missing docstring for the new param

Copy link
Member

@lovesegfault lovesegfault left a comment

Choose a reason for hiding this comment

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

approved, but left a comment on a stale docstring

@xokdvium xokdvium added this pull request to the merge queue Feb 23, 2026
Merged via the queue into NixOS:master with commit 7cd7930 Feb 23, 2026
15 checks passed
@xokdvium xokdvium deleted the fix-interrupts-write-full branch February 23, 2026 14:54
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

Successfully merging this pull request may close these issues.

2 participants