From 24f2bd8c9f62409ef7d7c919c9a53f438ee991cb Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 20 May 2000 22:06:38 +0000 Subject: Arrange to call close_stdout upon exit. Don't close stdout explicitly. --- src/fmt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/fmt.c') diff --git a/src/fmt.c b/src/fmt.c index 67aded871..49c692591 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -1,5 +1,5 @@ /* GNU fmt -- simple text formatter. - Copyright (C) 1994-1999 Free Software Foundation, Inc. + Copyright (C) 1994-2000 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ #define word unused_word_type #include "system.h" +#include "closeout.h" #include "error.h" #include "xstrtol.h" @@ -316,6 +317,8 @@ main (register int argc, register char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + atexit (close_stdout); + crown = tagged = split = uniform = FALSE; max_width = WIDTH; prefix = ""; @@ -412,9 +415,6 @@ main (register int argc, register char **argv) } } - if (ferror (stdout) || fclose (stdout) == EOF) - error (EXIT_FAILURE, errno, _("write error")); - exit (EXIT_SUCCESS); } -- cgit v1.2.3-54-g00ecf