diff --git a/ChangeLog b/ChangeLog index cd7cf2a..4c29888 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2000-08-19 Bruno Haible + * src/main.cc (main): Check for write error on stdout before returning. + * src/Makefile.in (LDFLAGS): New definition, to catch the value given at configure time. diff --git a/src/main.cc b/src/main.cc index 4e08633..03b6c7e 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,5 @@ /* Driver program for the Gen_Perf hash function generator - Copyright (C) 1989-1998 Free Software Foundation, Inc. + Copyright (C) 1989-1998, 2000 Free Software Foundation, Inc. written by Douglas C. Schmidt (schmidt@ics.uci.edu) This file is part of GNU GPERF. @@ -67,6 +67,10 @@ main (int argc, char *argv[]) /* Generates and prints the Gen_Perf hash table. */ int status = generate_table (); + /* Check for write error on stdout. */ + if (fflush (stdout) || ferror (stdout)) + status = 1; + /* Don't use exit() here, it skips the destructors. */ return status; }