summaryrefslogtreecommitdiffstats
path: root/include/closestream.h
Commit message (Collapse)AuthorAgeFilesLines
* include/closestream: avoid close more than onceKarel Zak2019-06-171-2/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use __SANITIZE_ADDRESS__ rather than custom USE_CLOSE_ATEXITKarel Zak2019-05-071-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/closestream: add close_stdout_atexit()Karel Zak2019-04-161-0/+11
| | | | | | | | It seems better to have a way to control when atexit(close_stdout()) is used, because close stdout means that for example ASAN (or another into binary integrated tool) is not able to print the final summary. Signed-off-by: Karel Zak <kzak@redhat.com>
* closestream: remove dummy function __fpending()Sami Kerola2018-03-271-9/+7Star
| | | | | | | | Exclude __fpending() from build when function is not available. This is more obvious than adding a dummy function and expecting compiler to eliminate it as dead code. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include/closestream: define exit codesKarel Zak2016-08-161-2/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/closestream: don't wipe errno on EPIPEKarel Zak2014-03-131-1/+2
| | | | | | | ... the code in close_stdout() is sensitive to EPIPE, so wipe errno is close_stream() is probably bad idea. Signed-off-by: Karel Zak <kzak@redhat.com>
* include: add close_fd() for noticing write errors before close()Sami Kerola2013-04-261-0/+19
| | | | | | | | | | | Essentially this helper function is similar to close_stream(), but for file descriptors. When a file descriptors are close()'d status of write is often overlooked. The close_fd() will try to determine what happen to writes with fsync() before closing the file descriptor. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: determine availability of __fpending()Sami Kerola2012-04-231-0/+10
| | | | | | | | Needed to for making Cygwin more possible. Reference: http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/5656 Reported-by: Bernhard Voelker <bernhard.voelker@siemens-enterprise.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include: add stream error checking facilitySami Kerola2012-04-041-0/+41
The close_stream() is copied from GNU lib. Inspiration to do this is talk by Jim Meyering - Goodbye World! The perils of relying on output streams in C. Reference: http://www.irill.org/events/ghm-gnu-hackers-meeting/videos/jim-meyering-goodbye-world-the-perils-of-relying-on-output-streams-in-c Signed-off-by: Sami Kerola <kerolasa@iki.fi>