From da258119328fe4af0e0aa0d6f292600732aa0bb4 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 14 Jan 1999 15:37:04 +0000 Subject: [PATCH] Include closeout.h. (main): Use close_stdout. --- src/hostid.c | 6 +++--- src/tee.c | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/hostid.c b/src/hostid.c index 1b8cff5bca..558d6e4010 100644 --- a/src/hostid.c +++ b/src/hostid.c @@ -1,5 +1,5 @@ /* print the hexadecimal identifier for the current host - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1999 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 @@ -25,6 +25,7 @@ #endif #include "system.h" +#include "closeout.h" #include "long-options.h" #include "error.h" @@ -73,8 +74,7 @@ main (int argc, char **argv) id = gethostid (); printf ("%lx\n", id); - if (fclose (stdout) == EOF) - error (EXIT_FAILURE, errno, _("write error")); + close_stdout (); exit (EXIT_SUCCESS); } diff --git a/src/tee.c b/src/tee.c index 302c4b7349..eac1eab3b7 100644 --- a/src/tee.c +++ b/src/tee.c @@ -1,5 +1,5 @@ /* tee - read from standard input and write to standard output and files. - Copyright (C) 85,90,91,92,93,94,95,96,1997 Free Software Foundation, Inc. + Copyright (C) 85,1990-1999 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 @@ -24,6 +24,7 @@ #include #include "system.h" +#include "closeout.h" #include "error.h" int full_write (); @@ -151,8 +152,9 @@ main (int argc, char **argv) errs = tee (argc - optind, (const char **) &argv[optind]); if (close (0) != 0) error (1, errno, _("standard input")); - if (close (1) != 0) - error (1, errno, _("standard output")); + + close_stdout (); + exit (errs); } -- 2.47.3