/* 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
#include <sys/types.h>
#include "system.h"
+#include "closeout.h"
#include "getline.h"
#include "error.h"
#include "getdate.h"
show_date (format, when);
}
- if (fclose (stdout) == EOF)
- error (2, errno, _("write error"));
+ close_stdout_status (2);
exit (status);
}
/* 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
#include <getopt.h>
#include "system.h"
+#include "closeout.h"
#include "error.h"
/* The name this program was run with. */
exit_status = (matches != argc - optind);
}
- if (ferror (stdout) || fclose (stdout) == EOF)
- error (2, errno, _("standard output"));
+ close_stdout_status (2);
exit (exit_status);
}
/* 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
#include <sys/types.h>
#include "system.h"
+#include "closeout.h"
#include "error.h"
static void usage PARAMS ((int status));
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);