summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/date.c7
-rw-r--r--src/printenv.c6
-rw-r--r--src/tty.c6
3 files changed, 9 insertions, 10 deletions
diff --git a/src/date.c b/src/date.c
index 79eaf4f03..c826d0191 100644
--- a/src/date.c
+++ b/src/date.c
@@ -1,6 +1,5 @@
/* date - print or set the system date and time
- Copyright (C) 89, 90, 91, 92, 93, 94, 95, 96, 1997
- Free Software Foundation, Inc.
+ Copyright (C) 1989-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 +23,7 @@
#include <sys/types.h>
#include "system.h"
+#include "closeout.h"
#include "getline.h"
#include "error.h"
#include "getdate.h"
@@ -357,8 +357,7 @@ argument must be a format string beginning with `+'."),
show_date (format, when);
}
- if (fclose (stdout) == EOF)
- error (2, errno, _("write error"));
+ close_stdout_status (2);
exit (status);
}
diff --git a/src/printenv.c b/src/printenv.c
index b334d8e74..8a85157e3 100644
--- a/src/printenv.c
+++ b/src/printenv.c
@@ -1,5 +1,5 @@
/* printenv -- print all or part of environment
- Copyright (C) 89,90,91,92,93,94,95,96,1997 Free Software Foundation, Inc.
+ Copyright (C) 89,90,91,92,93,94,95,96,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
@@ -33,6 +33,7 @@
#include <getopt.h>
#include "system.h"
+#include "closeout.h"
#include "error.h"
/* The name this program was run with. */
@@ -136,8 +137,7 @@ main (int argc, char **argv)
exit_status = (matches != argc - optind);
}
- if (ferror (stdout) || fclose (stdout) == EOF)
- error (2, errno, _("standard output"));
+ close_stdout_status (2);
exit (exit_status);
}
diff --git a/src/tty.c b/src/tty.c
index 724f21380..6e7f180ac 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -1,5 +1,5 @@
/* tty -- print the path of the terminal connected to standard input
- Copyright (C) 90,91,92,93,94,95,96,1997 Free Software Foundation, Inc.
+ Copyright (C) 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
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include "system.h"
+#include "closeout.h"
#include "error.h"
static void usage PARAMS ((int status));
@@ -102,8 +103,7 @@ main (int argc, char **argv)
else
puts (_("not a tty"));
- if (ferror (stdout) || fclose (stdout) == EOF)
- error (3, errno, _("standard output"));
+ close_stdout_status (3);
}
exit (isatty (0) ? 0 : 1);