From bf121d8ed4a8372f9023c34336bf700497113f0d Mon Sep 17 00:00:00 2001 From: dds Date: Sat, 4 Oct 2003 07:16:40 +0000 Subject: [PATCH] Check for write errors; report and exit with error value. --- bin/date/date.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/date/date.c b/bin/date/date.c index 725a435836f3..c71f9d3c3668 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -175,6 +175,8 @@ main(int argc, char *argv[]) vary_destroy(v); (void)strftime(buf, sizeof(buf), format, <); (void)printf("%s\n", buf); + if (fflush(stdout)) + err(1, "stdout"); exit(retval); }