mirror of
https://git.savannah.gnu.org/git/gperf.git
synced 2025-12-02 21:19:24 +00:00
Check for write error on stdout.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user