diff options
author | Sami Kerola <kerolasa@iki.fi> | 2012-03-23 11:10:04 +0100 |
---|---|---|
committer | Sami Kerola <kerolasa@iki.fi> | 2012-03-23 15:57:41 +0100 |
commit | c7cf98b0e03780f78abe5275c6fb282f71a2369f (patch) | |
tree | 922269cec4c0e6edb667a49de0e5f659faa6276e /include | |
parent | 1462c4e581caf22b2e7fe155691dfcddcb51b3f7 (diff) | |
download | procps-ng-c7cf98b0e03780f78abe5275c6fb282f71a2369f.tar.gz |
lib: add fileutils file with stream error checking facility
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/fileutils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/fileutils.h b/include/fileutils.h new file mode 100644 index 0000000..cfab570 --- /dev/null +++ b/include/fileutils.h @@ -0,0 +1,7 @@ +#ifndef PROCPS_NG_FILEUTILS +#define PROCPS_NG_FILEUTILS + +int close_stream(FILE * stream); +void close_stdout(void); + +#endif |