Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcomposefs: do not override errno #307

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

giuseppe
Copy link
Member

do not override the errno reported by the write_cb as we might lose useful errors like ENOSPC.

do not override the errno reported by the write_cb as we might lose
useful errors like ENOSPC.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@@ -275,9 +275,9 @@ int lcfs_write(struct lcfs_ctx_s *ctx, void *_data, size_t data_len)

if (ctx->write_cb) {
while (data_len > 0) {
errno = EIO;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I guess we need to do this because we can't rely on callers setting errno...and indeed in our own code which uses fwrite, it doesn't?

So...okay, is there really no way to get the actual error out of ferror?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I guess fwrite is...somewhat expected conventionally to set errno, but it's not standardized?

@cgwalters cgwalters merged commit 3a87868 into containers:main Jul 30, 2024
24 checks passed
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