| 921 | static int synchronize_output (void); |
| 922 | |
| 923 | static void |
| 924 | cleanup (void) |
| 925 | { |
| 926 | if (!interrupt_signal) |
| 927 | { |
| 928 | int sync_status = synchronize_output (); |
| 929 | if (sync_status) |
| 930 | exit (sync_status); |
| 931 | } |
| 932 | |
| 933 | if (iclose (STDIN_FILENO) != 0) |
| 934 | error (EXIT_FAILURE, errno, _("closing input file %s"), |
| 935 | quoteaf (input_file)); |
| 936 | |
| 937 | /* Don't remove this call to close, even though close_stdout |
| 938 | closes standard output. This close is necessary when cleanup |
| 939 | is called as a consequence of signal handling. */ |
| 940 | if (iclose (STDOUT_FILENO) != 0) |
| 941 | error (EXIT_FAILURE, errno, |
| 942 | _("closing output file %s"), quoteaf (output_file)); |
| 943 | } |
| 944 | |
| 945 | /* Process any pending signals. If signals are caught, this function |
| 946 | should be called periodically. Ideally there should never be an |
no test coverage detected