1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

Check for write error on stdout.

This commit is contained in:
Bruno Haible
2000-08-19 09:16:11 +00:00
parent aff9672e5d
commit bebc542b9e
2 changed files with 7 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
2000-08-19 Bruno Haible <bruno@linuix.math.u-bordeaux.fr> 2000-08-19 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
* src/main.cc (main): Check for write error on stdout before returning.
* src/Makefile.in (LDFLAGS): New definition, to catch the value given at * src/Makefile.in (LDFLAGS): New definition, to catch the value given at
configure time. configure time.

View File

@@ -1,5 +1,5 @@
/* Driver program for the Gen_Perf hash function generator /* 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) written by Douglas C. Schmidt (schmidt@ics.uci.edu)
This file is part of GNU GPERF. This file is part of GNU GPERF.
@@ -67,6 +67,10 @@ main (int argc, char *argv[])
/* Generates and prints the Gen_Perf hash table. */ /* Generates and prints the Gen_Perf hash table. */
int status = generate_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. */ /* Don't use exit() here, it skips the destructors. */
return status; return status;
} }