Skip to content

fs: handle an interrupted read("all") - #514

Open
lvoegl wants to merge 1 commit into
ucode-lang:masterfrom
lvoegl:read-all-interrupt
Open

lvoegl wants to merge 1 commit into
ucode-lang:masterfrom
lvoegl:read-all-interrupt

Conversation

@lvoegl

@lvoegl lvoegl commented Oct 30, 2026

Copy link
Copy Markdown

read("all") stops at the first fread() that returns 0 without checking ferror(), so a read error looks like an EOF: truncated or empty data, no fs.error().

In uloop hosts like rpcd, this is triggered by any exiting child via EINTR.

This PR makes read("all") retry on EINTR.

read("all") reads until fread() returns 0 without checking ferror(), so a
failed read ends it like EOF: the data is truncated or empty and fs.error() is
unset.
In uloop hosts such as rpcd, libubox's SIGCHLD handler lacks SA_RESTART, so any
exiting child causes this via EINTR. EINTR is now retried.

Assisted-By: LLM
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>

This branch has not been deployed

No deployments
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.

1 participant