[Rpm-maint] [rpm-software-management/rpm] Error out on --eval if stdout write fails (#1444) (#1562)

Michal Domonkos notifications at github.com
Mon Mar 1 13:00:05 UTC 2021


Since --eval only has one job - to actually *print* something to stdout,
we should fail completely if that's not possible due to an external
error, instead of just not printing anything.  One particular case is
redirecting stdout to a file on a file system that's full (generating
the ENOSPC error).

In order to be able to detect such errors, we need to flush the stream
buffer first; that's because normally, if stdout is not referring to an
interactive device (a terminal), it is block-buffered, as opposed to
line-buffered.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/1562

-- Commit Summary --

  * Error out on --eval if stdout write fails (#1444)

-- File Changes --

    M lib/poptALL.c (4)
    M tests/rpmmacro.at (11)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1562.patch
https://github.com/rpm-software-management/rpm/pull/1562.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1562
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210301/0376bf8c/attachment.html>


More information about the Rpm-maint mailing list