diff options
author | Jim Meyering <jim@meyering.net> | 1998-01-04 22:45:28 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-01-04 22:45:28 +0000 |
commit | 5d4f8ebdfda9a4aadaeb30aebd34542e55bc13e1 (patch) | |
tree | ebcd4ea3aeb95093c8658d1442ee10612a29f438 /src/dircolors.c | |
parent | b246280c27644ec0f08909d33e652cabb6b16981 (diff) | |
download | coreutils-5d4f8ebdfda9a4aadaeb30aebd34542e55bc13e1.tar.xz |
(main, usage): Check for write error to stdout before exiting.
Include "closeout.h".
Diffstat (limited to 'src/dircolors.c')
-rw-r--r-- | src/dircolors.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/dircolors.c b/src/dircolors.c index f024396a2..b16d7e27a 100644 --- a/src/dircolors.c +++ b/src/dircolors.c @@ -1,6 +1,6 @@ /* dircolors - output commands to set the LS_COLOR environment variable Copyright (C) 1994, 1995, 1997 H. Peter Anvin - Copyright (C) 96, 1997 Free Software Foundation, Inc. + Copyright (C) 96, 97, 1998 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 @@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "system.h" #include "getline.h" #include "long-options.h" +#include "closeout.h" #include "error.h" #include "obstack.h" #include "dircolors.h" @@ -114,6 +115,7 @@ file types and extensions. Otherwise, a precompiled database is used.\n\ For details on the format of these files, run `dircolors --print-database'.\n\ ")); puts (_("\nReport bugs to <fileutils-bugs@gnu.org>.")); + close_stdout (); } exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE); @@ -516,8 +518,7 @@ dircolors' internal database")); } } - if (fclose (stdout) == EOF) - error (EXIT_FAILURE, errno, _("write error")); + close_stdout (); if (have_read_stdin && fclose (stdin) == EOF) error (EXIT_FAILURE, errno, _("standard input")); |