From b87cbe8486a2799a137c8100afaa05b352bb0ccf Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Wed, 4 Apr 2012 19:39:15 +0200 Subject: text-utils: verify writing to streams was successful Signed-off-by: Sami Kerola --- text-utils/colrm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'text-utils/colrm.c') diff --git a/text-utils/colrm.c b/text-utils/colrm.c index d454643a0..910d933a2 100644 --- a/text-utils/colrm.c +++ b/text-utils/colrm.c @@ -41,11 +41,13 @@ #include #include #include +#include #include "nls.h" #include "widechar.h" #include "strutils.h" #include "c.h" +#include "closestream.h" /* COLRM removes unwanted columns from a file @@ -162,6 +164,7 @@ int main(int argc, char **argv) setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); + atexit(close_stdout); while ((opt = getopt_long(argc, argv, "bfhl:pxVH", longopts, @@ -187,7 +190,5 @@ int main(int argc, char **argv) ; fflush(stdout); - if (ferror(stdout) || fclose(stdout)) - return EXIT_FAILURE; return EXIT_SUCCESS; } -- cgit v1.2.3-55-g7522